Quantcast
Channel: Power Query topics
Viewing all 31322 articles
Browse latest View live

Excel - Get & Transform (Power Query) - Moving average grouped data w/ DAX

$
0
0

Hi,

 

Hi, Can someone assist on moving average when data is grouped? below is an example:

looking for moving average on data grouped by "item" column.

 

Thanks!

 

5.png


Delay web query until condition met from another web query

$
0
0

I use an API that provides a Json response which includes a statusUrl and a downloadUrl.

If I immediately hit up the downloadUrl there is usually no data.

The statusUrl Json response advises when the report generation is "COMPLETE" and the reportUrl can be used to get the data.

 

Can I set up some sort of condition to check that a value in the statusUrl Json response (which I can convert to a normal table or list if easier) = "COMPLETE" or if it's "FAILED" or if it's "NOT READY"?

Then if it shows "COMPLETE" it runs Csv.Document(Web.Contents(downloadUrl),...) , if it's "NOT READY" it delays for a few seconds and tries again (a loop?) and if it's "FAILED" the output is an error message.

Power Query - Sum by Category WITHOUT Grouping

$
0
0

Hi,

 

I have a table that has the total population figures for a specific demographic across 5 cities for 2017, 2018 and 2019. I want to work out the percentage of population each city has for each year. Here's an example of the data I'm working with:

 

01.PNG

 

Is there any way to do this where I can create another column with the total across the locations for each year?

 

Thanks,

MarkJames

Upload Error

$
0
0

Dear Team,

Am trying to upload an excel into my power Bi Model and every time I do it gives me the above error below. The file extension is .XLSX but even a CSV or a .xls is not workingError in Power Bi.GIF

Combining Multiple Unique CSV Files Into One

$
0
0

Hello,

 

I have 5 different CSV files. They all have different patient information (synthetic so not real). All files have a unique ID which is "patient_id" which I want to join. As in the picture, I want to combine this medications file with the age file and the condition file, etc into one single CSV. I have already created relationships but would like to get the CSV so I can import into R and do some survival analysis off of it. Thanks for any help! Pic.PNG

Add data directly in the inform panel

$
0
0

Hello

 

Is there any way to add information directly in the Inform panel (using a box), like this where the user only has tu write numbers using the keyboard?

pregunta ingreso de informacion.png

 

 

Retaining email metadata when aggregating attachments.

$
0
0

Hello all.  

I've got a PQ script that's aggregating multiple excel attachments from multpile emails (in a given folder).  So when I combine binaries, all the other email information columns aren't retained.  What I'd like to do is add the sender and timestamp as columns in my aggregated data so a record can be back-tracked to the original email.  Is this possible when combining binaries like this?

Thanks,

-Chris

Losing Column Values when Using 'Combine' for CSV values

$
0
0

Using Combine .csvs for 5 identically formatting CSV files in powerquery. I have a field called 'DATE' which is the first column in the files, and the row values are loading correctly for the first csv file, but for the following 4 files, I'm losing the row values in the column DATE in the other csv's. They are blank, but in the source file csvs they are not.  Any ideas? 

SourceInventory List.PNGList of Steps Combine.PNG


Create subtable based on comma separated value in main table

$
0
0

Hello,

 

We are connecting to Dynamics 365 and - in several tables - we have multiselect pick lists.  i.e. When we enter a contact we can select multiple values of the 'contact type' for a given contact - example in table below.  John Smith is both a Salesperson and an Account Manager.

This contact field is displayed as a comma separated value in PBI table.  How can we break this out to display as a separate table?  We'd also want to have the contact name so can join back to main Contact table.  (In reality would use key/ID fields instead of name - thisis just for the example).

Appreciate any help you can provide.

 

 

Thanks,

Dan


PBI_Dynamics_CommaSeparated.PNG

Power Query Not Showing second decimal if zero

$
0
0

I'm having an issue in excels power query.

I can not figure out how to always show two decimal places.

For example, in excel it displays like this which is perfect

  • 1.21 = 1.21
  • 1.30 = 1.30

In Power Query It displays like this

  • 1.21 = 1.21
  • 1.30 = 1.3

Power Query removes the second decimal if its a zero. I'm trying to use this as a lookup by converting it to text as its my only unique number

Create header with the 2 first row?

$
0
0

Hi,

I start with a excel calandar as source, in the calandar the first row are the month and year and the second row are the day. Also when I import it the month and year are only in the first column., don't relpicate on other one look the the image below 

2019-07-05 14_22_51-absence - Power Query Editor.png

 

The result I'm looking for is :

 

2019-07-05 14_35_59-absence - Power Query Editor.png

 

Also after Janvier (january) it's February:

 

2019-07-05 14_41_39-absence - Power Query Editor.png

Bug in Power Query? Losing records after change order of filtering. Weird puzzle??

$
0
0

I want to report the total visits on webpages for our organization. The data I get from Google Analytics; A total of 190.000 records of page-counts, per site, per day over the last 2 years. However, it seems that 'Power Query' loses records when changing the filtering order. I have applied two filters, in the sequence below (see first printscreen);

First filter                            [Rijen gefilterd2], each [Date] = #date(2019, 2, 12)

Second filter                      [Rijen gefilterd], each Text.Contains([Page path level 3], "25480")

figure 1: the good result

Power Query good result.png

when I change the order of the two filters the outcome is wrong, I only get 4 records with different totals.

Power Query wrong result.png

What is going on????? I don’t understand why I lose records with the same filtering but different sequence.  When I delete the two filters, and load the data into power bi and drop it in a table and do the same filtering, I also get the incorrect records.

 

Power BI desktop result.png

 

Is this a bug? Can any one me help to solve this problem. Do I have to report this to Microsoft?

I’m already struggeling for 6 hours on this problem.

Multiple Tables to lookup dates

$
0
0

Been trying to learn DAX / M by creating my own problems (no pun intended) and trying to solve... no success here for the last few days with this problem.

 

Trying to find the difference between first appointment date and when patient was created, excluding weekends.  

 

I have to find the min appointment date for each chart number.  Then lookup the date in the date dimension and subtract the date key (?) for whatever date the patient was created, but then subtract any weekends.

 

Make sense?  Best with DAX or M?

 

Layout:

layout.JPG

Date Dimension Table:

date dim.JPG

Patient Table:

patient table.JPG

Appointment Table:

appointments.JPG

Replace value based on duplicate column with priority

$
0
0

Hi all,

 

I am currently trying to proccess some raw data into our budget.

 

I have refined it down as far as i can and as far as i need however as new data gets added i need to replace the old.

 

The movements are a PO can be APPR from there it will move to CLOSE or CANC. However it wil have a new status date when this status changes from APPR. I need to keep the original status date as this is the months budget this will be coming from, but update the status to CLOSE/CANC. From here if the status is CANC i will filter it out of results.

 

I have attached a photo for reference.Untitled.jpg

 

Is this possible through Power Query?

How to choose the record with the highest value by group

$
0
0

Hi everybody,

 

I would like to ask, how to choose the last record in table. I have table with many rows. I would like to recognize and choose only rows, where the value is the highest.

 

Example:

ID | Group name | Value

0 | All | 0

1 | Woman | 1

2 | Man | 1

3 | Woman's T-shirt | 2

4 | Woman's shoes | 2

5 | Woman's socks | 2

 

The result is:

3 | Woman's T-shirt | 2

4 | Woman's shoes | 2

5 | Woman's socks | 2

AND

2 | Man | 1

 

because group Man doesn' t have higher value in column Value.

 

Do you know, how to do it? In real life it looks like tree, where you have groups and sub-groups. And you know ID employee (column ID) and you know his manager (because you have other columns as Manager, where is ID employee). So there is know superior and subordinate relationship.

 

I tried filter values by highest value, but I lost group Man with value 1. I tried change table from star to snowflake.

 

Do you have any ideas, how to solve it?

 

Thank you very much for help.

Mary


Importing a table using the location provided by CELL

$
0
0

Hi,

 

Please, Im working on a "File.xls" from a folder and transform it on "Final Results".

 

Every month I work on new data and the patterns are the same, only the location of my "File.xls" and "Final Results" changes.

 

Into my "Final Results" has table named ""Location" with function CELL, that gives me the address from my current file after apply LEFT and SEARCH, like this

 

VALUE = LEFT(CELL("filename");SEARCH("[Ser";CELL("filename"))-1)

 

I add to this function a &"File.xls" concatenating with the address, like this:

 

VALUE = LEFT(CELL("filename");SEARCH("[Ser";CELL("filename"))-1)&"File.xls"

 

FINAL VALUE = C:\Users\felipe.vaz\FolderJan\File.xls

 

Every month I download a new "File.xls" again and copy and paste that "Final Results" to a new folder (FolderFeb) and it gives me the position where the new "File.xls" is.

 

I want to use the FINAL VALUE to open the new File.xls every month. But I do know how to transform the final value to use into the Excel.Workbook()

 

Ive tried

 

= Excel.Workbook(File.Contents(Table.FromRecords(Location())), null, true) tells me that unable to convert...

 

Any idea?

 

Files here

 

 

 

 

Choose the record with the last date

$
0
0

Hi everybody,

 

I would like to ask for help. I have table with rows and I would like to choose value from row, where the date is the last.

 

Example:

Customer | Type | Date | Note

ABC | E-mail | 01/07/2019 | Sended

ABC | Call | 02/07/2019 | He promised something ...

ABC | Call | 03/07/2019 | He is not answering.

 

How to receive values from row with date 09/07/2019? I tried to use DAX using LAST function. It works in Desktop. But after few day I receive bad feedback, because it doens't work, but synchronization works.

 

Do you know how to solve it? Thank you for help.

Mary

Use Python in Power BI

$
0
0

Hello, I need to use python in Power BI, I already installled all the Python modules and I have to use 

the NPV function from numpy library but I don´t know how to select the data to use in the script from the .xlsx file that I already uploaded, I nedd to use the value from 'TASA DE INTERES' as rate, and 'FLUJO DE CAJA' as values.

NPV duda.jpgNPV mensaje de error.jpg

NPV duda.jpg

Throw 401 Exception

$
0
0

Hi,

I am developing a custom connector and I'm making a TestConnection, so I would like to know if I can throw a 401 exception like Web.Contents does, for re-prompt credentials.

The API always returns a 200 and the error goes into the body, is there a way to achieve a re-prompt or throw 401 exception?

 

Thanks in advance

M Language transformation of rows to table

$
0
0

Hi All

I have a table with one column and trying to perform following transformation described below.

Is there any way to do it via M?Example.png

 

Viewing all 31322 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>