The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now
Hi All,
New to Power BI.
Loving it, but having an issue.
I am trying to recreate the below pivot table
The Total Aged Stock column is currently a sum in excel, adding various aging "buckets"
I am able to recreate the majority of the table in Power BI, with the exception of this one column.
I believe this may be achiveable via measures or a calculated column, but am struggling to find a working solution.
Any help is appriciated, thanks all.
Solved! Go to Solution.
Hi @JrobertsUK,
Based on my assumption, I created a sample data table named as 'Test2'.
In above table, please create two calculated columns:
sum over 60 days = CALCULATE ( SUM ( 'Test 2'[Ages] ), FILTER ( ALLEXCEPT ( 'Test 2', 'Test 2'[Customer NO] ), 'Test 2'[Cat] <> "0-30 days" && 'Test 2'[Cat] <> "31-60 days" ) ) Sum total = CALCULATE ( SUM ( 'Test 2'[Ages] ), ALLEXCEPT ( 'Test 2', 'Test 2'[Customer NO] ) )
Then, create a calculated table like below:
summarize table = UNION ( SELECTCOLUMNS ( 'Test 2', "Customer NO", 'Test 2'[Customer NO], "Age", 'Test 2'[Ages], "Cat", 'Test 2'[Cat] ), SUMMARIZE ( 'Test 2', 'Test 2'[Customer NO], "Age", AVERAGE ( 'Test 2'[sum over 60 days] ), "Cat", "Over 60 days" ), SUMMARIZE ( 'Test 2', 'Test 2'[Customer NO], "Age", AVERAGE ( 'Test 2'[Sum total] ), "Cat", "Total" ) )
Add corresponding fields from above new table into matrix visual. Remember to turn off the "Column Total" under format panel.
To follow RolandsP's suggestion that use Drill Down as a workaround, please see below steps.
In report view, choose the [Cat] column, meanwhile, click the "New Group" button.
Set groups like below:
After than, you will get a new group column in original table. Add the new group to "Columns" section in Matrix visual.
On top level, matrix show total values for "Over 60 days". When you click the highlighted drill down icon, matrix will show total values across all groups.
Best regards,
Yuliana Gu
Hi @JrobertsUK,
Based on my assumption, I created a sample data table named as 'Test2'.
In above table, please create two calculated columns:
sum over 60 days = CALCULATE ( SUM ( 'Test 2'[Ages] ), FILTER ( ALLEXCEPT ( 'Test 2', 'Test 2'[Customer NO] ), 'Test 2'[Cat] <> "0-30 days" && 'Test 2'[Cat] <> "31-60 days" ) ) Sum total = CALCULATE ( SUM ( 'Test 2'[Ages] ), ALLEXCEPT ( 'Test 2', 'Test 2'[Customer NO] ) )
Then, create a calculated table like below:
summarize table = UNION ( SELECTCOLUMNS ( 'Test 2', "Customer NO", 'Test 2'[Customer NO], "Age", 'Test 2'[Ages], "Cat", 'Test 2'[Cat] ), SUMMARIZE ( 'Test 2', 'Test 2'[Customer NO], "Age", AVERAGE ( 'Test 2'[sum over 60 days] ), "Cat", "Over 60 days" ), SUMMARIZE ( 'Test 2', 'Test 2'[Customer NO], "Age", AVERAGE ( 'Test 2'[Sum total] ), "Cat", "Total" ) )
Add corresponding fields from above new table into matrix visual. Remember to turn off the "Column Total" under format panel.
To follow RolandsP's suggestion that use Drill Down as a workaround, please see below steps.
In report view, choose the [Cat] column, meanwhile, click the "New Group" button.
Set groups like below:
After than, you will get a new group column in original table. Add the new group to "Columns" section in Matrix visual.
On top level, matrix show total values for "Over 60 days". When you click the highlighted drill down icon, matrix will show total values across all groups.
Best regards,
Yuliana Gu
You need to run new grouping ( using New Groups) on your ageing column and classify it in 3 groups: 0-30 Days, 31-60 Days and Over 60 Days (this would include all your groups over 60 days). And then in the matrix, you would include two levels in columns - New Grouping column, and existing ageing column. Then you will be able to drill in first level group Over 60 days to show more granular breakdown. This would be a little bit different structure from Excel pivotable, but very close one.
Thanks for the rapid response Roland. I've tried to do this as per your instructions, but am struggling. Do you have any practical examples?
You need to do following steps:
1) Select the current grouping column
2) Then you need to select New Group under Modelling tab.
3) There from Ungrouped value you select current group 0-30 Days and press Group, then select 31-60 days and press Group, then select all remaining values holding CTRL and press Group. You can change the name for this new group.
4) Now you have new column in the table that you can include in columns in matrix.
Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.
User | Count |
---|---|
158 | |
106 | |
96 | |
83 | |
75 |
User | Count |
---|---|
153 | |
137 | |
131 | |
81 | |
61 |