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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Matrix not returning the correct Total Amount

Hello,

 

I would like to build a matrix that would return the correct total amount.

 

The rows on this matrix are pre-defined by an auxiliary table (since I want want them to follow that Order).

 

The auxiliary table that looks like the following:

 

Measure       Index

Measure 11
Measure 22
Measure 33
Measure 44

 

And a measure is the following:

Table_Measures = SWITCH(
     LASTNONBLANK(Aux[Measure],1),
     "Measure 1",10,
     "Measure 2",20,
     "Measure 3",5,
     "Measure 4",5,
"")
 
Screenshot_1.png
I would like my Matrix to return the correct total (40), and instead returns amount 5:
 
Any help would be much appreciated. 🙂
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try something like

 

Total=

var Table_Measures = SWITCH(
     LASTNONBLANK(Aux[Measure],1),
     "Measure 1",10,
     "Measure 2",20,
     "Measure 3",5,
     "Measure 4",5,
"")
 
return
if(hasonevalue[aux[measure]],Table_Measures,sum([Table_Measures])
 
 
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Try something like

 

Total=

var Table_Measures = SWITCH(
     LASTNONBLANK(Aux[Measure],1),
     "Measure 1",10,
     "Measure 2",20,
     "Measure 3",5,
     "Measure 4",5,
"")
 
return
if(hasonevalue[aux[measure]],Table_Measures,sum([Table_Measures])
 
 
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.
Anonymous
Not applicable

It worked 🙂

 

Thank you so much!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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