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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Only show measure value for certain row value in Matrix

Hi All

 

I need some help with a measure I have created showing correctly for a given row value on a matrix visual. In my model I have 3 tables (Date, Reporting, and Financial). Date and Reporting are Dims and Finacial is the Fact. I have a measure called TotalExpenseAmt which is structured like this:

 

TotalExpenseAmt =
CALCULATE(SUM(Financial[Amount]),Reporting[LOSGroup] IN {"EXPENSES"})
 
One of the attributes in Reporting is LOSGroup. When I have "TOTAL EXPENSES" on the row I would like to display this measure value. Otherwise I just want to show the value for Amount. Displaying my measure shows this for all row values. How would I switch it to only show for the "TOTAL EXPENSE" row. For the highlighted value I want it to show. Also show the Detail values for Expenses such as "GP&T", "REPAIRS", etc. That's fine. But for say "CAPITAL" i want it to be blank
 
ScottC60540_0-1679763270528.png

 

 
I have the pbix file here  SampleLOSGroup.pbix
 
This seems like a simple thing but my iterations with this measure just havent been successful right now. Appreciate any help.
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try this:

TotalExpenseAmt =
  VAR __LOSGroup = MAX('Reporting'[LOSGroup])
  VAR __Result = 
    IF( __LOSGroup = "TOTAL EXPENSES",
      CALCULATE(SUM('Financial[Amount']),'Reporting'[LOSGroup] IN {"EXPENSES"}),
      SUM('Financial'[Amount])
    )
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
Anonymous
Not applicable

Thanks Greg. That appears to work. I appreciate it

Greg_Deckler
Community Champion
Community Champion

@Anonymous Try this:

TotalExpenseAmt =
  VAR __LOSGroup = MAX('Reporting'[LOSGroup])
  VAR __Result = 
    IF( __LOSGroup = "TOTAL EXPENSES",
      CALCULATE(SUM('Financial[Amount']),'Reporting'[LOSGroup] IN {"EXPENSES"}),
      SUM('Financial'[Amount])
    )
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...
Anonymous
Not applicable

@Greg_Deckler  I think my initial problem is that the relationship between the Reporting and Financial tables is "Both" (i.e. bi-directional). If we switch it to that you can see the issue:

ScottC60540_0-1679928264914.png

If I am forced to have bi-directional between these tables how can I get that measure to work?

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.