Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Total in Table and Matrix as as calculation of other columns' totals

Hi everyone!

 

I am looking for help in a case that seems easy, but I couldn't find any solution neither in PBI Community nor anywhere in the Internet. I found a lot of similar cases but none of them seems to be what I'm looking for. I wasn't able to create my own solution based on what I found so I decided to ask directly.

 

I need to visualise simple table where I have WN value for current year (WN 0) and WN value for last year (WN -1). I need to display % change of the value over the course of the year (% change), which I have calculated on the data source as well. All data are avalable for 5 groups (A-E).

 

I have all 5 rows in the data source (as in the screenshot below) so I basicly just need to display all of them in the Table.

The problem occurs with Total value. Total of '% change' is SUM by default (red -111% below). I need it to be % change of the SUM(WN 0) and SUM(WN -1):

((Total of WN 0) - (Total of WN -1)) / (Total of WN -1)

Like green -47% below.

Power BI.png

I have no idea how to modify column in order to recieve correct Total.

I tried to add Measure Column like

WhatINeed = DIVIDE((PBI_Daily_Groups[WN 0]-PBI_Daily_Groups[WN -1]), PBI_Daily_Groups[WN -1])

but that behave exactly like '% change' from the source, or:

WhatINeed = DIVIDE((sum(PBI_Daily_Groups[WN 0])-sum(PBI_Daily_Groups[WN -1])), sum(PBI_Daily_Groups[WN -1]))

And that displays correct value, but duplicates it for all of the rows (and I need original % value for all rows but Total).

 

I guess it is really easy, but I am definitely missing the point here. Is there any way to achieve my goal?

 

HARD MODE:

I also have a Matrix that decompose those values, like in example:

Power BI2.png

Subtotals and Totals behave in the same way as in the first example. Is it possible to achieve my goal for Totals and Subtotals in Matrix?

 

Best regards!

Michał

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

Thank for your replie. Here is a link to my pbix file:

https://drive.google.com/file/d/19vw_0NhFWBv8jwCPELVNu5K_sEciBKW9/view?usp=sharing

I would be grateful for any help!

 

Best regards,

Michał

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you for your effort Ashish!


However I need to ask... what exactly did you modify? I can't find any differences between your file and my example 😅

 

Best regards,

Michał

Hi,

I do not remember all the changes that i made but i definitely wrote measures for W0 and W-1.  You had simply dragged those columns.

If my previous reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Of course, I'm kind of blind 😄 now I see and it works just fine! However I feel it should be more intuitive (like in Excel), I am so grateful to you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.