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

Inaccurate Matrix Subtotals with Multiple Measures

Hello,

 

I'm trying to build a matrix table that does two things simulataneously:

1. Change the values based on the any combination of currency selection(local or reporting currency (CAD)) and the overhead adjustment selection (multiple Sales by 1.35 if the department type is embedded)

2. Replace Forecast values with Actual values if the date is earlier than July 2022.

 

I was able to accomplish both 1. and 2. by first creating a measure using the switch function (called Measure1) and then I created a measure based on the results of Measure1 (called Measure2) to essentially replace Reforecast with Actual values if the year and month was less than 202207 without impacting the other category values. My measure seems to be working well as you can see in the screenshot below but my subtotals are displaying values from the Actuals instead of adding up the values within rows.

 

PBIPull3-1.png

 

I had asked a similar question before but I wasn't able to apply the same type of formula when it came to a measure instead of a column. I'd really appreciate your help with this. Sample file and PBIX file below:

 

My sample file: https://docs.google.com/spreadsheets/d/1ACRHp4Atj1eOOJzeoW7QyYAxKtgagz3s/edit?usp=sharing&ouid=10592...

 

My PBI file: https://drive.google.com/file/d/13yXlu8owLw4wLbaTAUtePPXVXqgXMQMF/view?usp=sharing

 

2 REPLIES 2
HoangHugo
Solution Specialist
Solution Specialist

Hi

I can't not understand your measure and matrix, but if you want to sum vales within rows in subtotal, please try format: SUMX(SUMMARIZE(year column), your formula)

Anonymous
Not applicable

Hi @HoangHugo ,

 

What doesn't make sense to you? I tried your formula and the subtotals summed up properly when the type was Actuals but not when the type was reforecast. Screenshot with the DAX is below:

PBIPull3-2.png

 

Measure3 = SUMX(SUMMARIZE('COMBINED ALL FINAL','COMBINED ALL FINAL'[Year]),
SWITCH( TRUE(),
MAX('COMBINED ALL FINAL'[Type])="Reforecast" && MIN('COMBINED ALL FINAL'[Year Month Code])<202207, CALCULATE([Measure1],'COMBINED ALL FINAL'[Type]="Actuals"),
CALCULATE([Measure1])))

 

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.