Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a column with multiple dimesnion rows, row1, row2, row3. Besides that i have a lot of measures to reflect on this.
I want to create a pivot table. But i want row1 and row 2 to show a subtotal for all the values. Below that i want row 3 to show, but below that i want a subtotal of row1, row,2, row3. I read about rollupaddissubtotal but i could not get it to work. Any suggestions?
Solved! Go to Solution.
Hi @bartw00
I've tried rollupaddissubtotal() function, but unfortunately that I don't get the correct outcome.
Maybe you can try this method as a alternative workaround:
First of all, add a index column in M query:
Then add a calculate column:
Subtotal =
VAR _sumAmount =
SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] <= EARLIER ( 'Table'[Index] ) ),
'Table'[Amount]
)
RETURN
IF (
'Table'[Index]
= MAXX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Level 1] = EARLIER ( 'Table'[Level 1] )
),
'Table'[Index]
),
_sumAmount
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @bartw00
Could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @v-zhengdxu-msft ,
Hereby an example. The problem that i am encountering is that everythin is on the same level. When calculating subtotals for groups F.E. It only calculates the subtotals for the groups and not the totals of previuos groups. I tried creating multiple tables and send them to back, but this gives issues with publishing in terms of placing the visuals. Hereby a sample:
Thanks in advance!
Hi @bartw00
I've tried rollupaddissubtotal() function, but unfortunately that I don't get the correct outcome.
Maybe you can try this method as a alternative workaround:
First of all, add a index column in M query:
Then add a calculate column:
Subtotal =
VAR _sumAmount =
SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Index] <= EARLIER ( 'Table'[Index] ) ),
'Table'[Amount]
)
RETURN
IF (
'Table'[Index]
= MAXX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Level 1] = EARLIER ( 'Table'[Level 1] )
),
'Table'[Index]
),
_sumAmount
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
99 | |
75 | |
64 | |
63 |
User | Count |
---|---|
140 | |
105 | |
102 | |
81 | |
67 |