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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dustdaniel
Helper II
Helper II

Percentage Variance on Rows total in a Matrix

Hi there,

 

I was requested in a matrix to show the % variance from 2025 vs 2024 instead of the sum as a total. Is this possible? Consider that all the values in the columns are measures.

 

dustdaniel_0-1753982749035.png

 

Thanks for the guidance.

1 ACCEPTED SOLUTION

@dustdaniel Well, not much information to go on so not sure how specific and accurate I can be but let's say you have a measure called "Dias", you could create the following measure and use it in your visualization instead:

Dias Total =
  VAR __Dias = [Dias]
  VAR __Dias2025 = CALCULATE( [Dias], 'Dates'[Year] = 2025 )
  VAR __Dias2024 = CALCULATE( [Dias], 'Dates'[Year] = 2024 )
  VAR __Result = IF( HASONEVALUE( 'Dates'[Year] ), __Dias, __Dias2025 - __Dias2024 )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@dustdaniel So yes. You could add a check in your measure formulas to check if there is a single value for Year. If not, then you are in a Total row and you can determine what to do from there. For example.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler 

Could you guide me here on how to do it?

 

Attached is my sample file

 

@dustdaniel Well, not much information to go on so not sure how specific and accurate I can be but let's say you have a measure called "Dias", you could create the following measure and use it in your visualization instead:

Dias Total =
  VAR __Dias = [Dias]
  VAR __Dias2025 = CALCULATE( [Dias], 'Dates'[Year] = 2025 )
  VAR __Dias2024 = CALCULATE( [Dias], 'Dates'[Year] = 2024 )
  VAR __Result = IF( HASONEVALUE( 'Dates'[Year] ), __Dias, __Dias2025 - __Dias2024 )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.