
Announcements
Hello - I am currently trying to find a way to pull monthly data from my powerbi dataset and add it to an excel table in order to store historical data but this is proving tricky. I have the below so far but when it ran no data came through, plus the excel bit does not allow any dynamic content so I am not sure how to align the correct columns. The DAX can also be found below.
I create a table in the dataset that I want extract which is simply 2 columns: Region & Count of Requests so it would look like:
| Benelux | 24 |
| France | 66 |
| Nordics | 12 |
And then at the end of the month I want this moved to an excel document to copy this but also to add the month that it was pulled in so it would look like:
| January | Benelux | 24 |
| January | France | 66 |
| January | Nordics | 12 |
And then continually add rows for the months ahead so we can track progress against this. Is this possible? I heard that it may be easier working with a powerbi dashboard rather than the dataset. TIA!
// DAX Query
DEFINE
VAR __DS0FilterTable =
TREATAS({"Request"}, 'TrainingRequests'[Gap/Request])
VAR __DS0Core =
SUMMARIZECOLUMNS(
'TrainingRequests'[Region],
__DS0FilterTable,
"CountTechnician", CALCULATE(COUNTA('TrainingRequests'[Technician]))
)
VAR __DS0PrimaryWindowed =
TOPN(501, __DS0Core, 'TrainingRequests'[Region], 1)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
'TrainingRequests'[Region]
Solved my own questions! But for anyone interested in the solution here is what I did:
You can get the DAX query from your powerbi dataset - just create a table that you want to essentially copy into the excel/csv. Then you need to go to the Optimize Tab --> Performance Analyzer --> and then click the 3 dots to get the dax query behind t he table. Then copy this over.
Hope this helps somebody else!