The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Table.Pivot(Table.TransformColumnTypes(#"Filtered Rows2", {{"created", type text}}), List.Distinct(Table.TransformColumnTypes(#"Filtered Rows2", {{"created", type text}})[created]), "created", "userID", List.Count)
Would anyone be able to tell me how to make this pivoted table show a running total?
Currently it has the country of an entry in the rows and the date in the columns...
Country | 1/1/19 | 2/1/19 | 3/1/19 | 4/1/19 | 5/1/19 |
GB | 0 | 0 | 0 | 1 | 0 |
NL | 1 | 1 | 0 | 0 | 0 |
CA | 0 | 1 | 2 | 0 | 0 |
I would like it to look like this...
Country | 1/1/19 | 2/1/19 | 3/1/19 | 4/1/19 | 5/1/19 |
GB | 0 | 0 | 0 | 1 | 1 |
NL | 1 | 2 | 2 | 2 | 2 |
CA | 0 | 1 | 3 | 3 | 3 |
Solved! Go to Solution.
Hi @Anonymous ,
You can download my proposed solution from here.
Here are the steps:
1) Unpivot the dates in Power Query to have a table as below
2) Add a measure for the cumulated value
Cumulated value =
var selectedDate = LASTDATE('Countries'[Date])
RETURN
CALCULATE(SUM('Countries'[Value]), 'Countries'[Date]<=selectedDate, ALLEXCEPT('Countries',Countries[Country]))
Here is a screenshot of the final table:
Is this what you are looking for?
LC
Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com
Hi @Anonymous ,
You can download my proposed solution from here.
Here are the steps:
1) Unpivot the dates in Power Query to have a table as below
2) Add a measure for the cumulated value
Cumulated value =
var selectedDate = LASTDATE('Countries'[Date])
RETURN
CALCULATE(SUM('Countries'[Value]), 'Countries'[Date]<=selectedDate, ALLEXCEPT('Countries',Countries[Country]))
Here is a screenshot of the final table:
Is this what you are looking for?
LC
Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com
User | Count |
---|---|
69 | |
64 | |
62 | |
55 | |
28 |
User | Count |
---|---|
203 | |
82 | |
65 | |
48 | |
38 |