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
shep123
Helper I
Helper I

How to include adjustment in subtotal measure

I have 2 tables, 1 dimension table that has a view of all the products and a fact table that has all the products and their targets. We intentionally set higher product targets than our overall goal. In the example below our company target is 200 but the sum of the individual products is actually 225, hence the -25 Prod Adjustment.

 

Dimension

ProductCountry
Prod AUS
Prod BUS
Prod CUS

 

Fact

ProductTarget
Prod A100
Prod B50
Prod C75
Prod Adjustment-25

 

When making a matrix the grand total aggregates properly but not the subtotal. I want the US row to also say 200. There are no other Countries besides US. We just use that for a top level of the hierarchy.

CountryTargets (Actual)
US225
    Prod A100
    Prod B50
    Prod C75
Total200

 

My current measures are in the attached file if that is helpful. The source of the issue is that [US Target] equals 225 and not 200. I don't know if I am on the right path for best way to accomplish this though. I also use a many to many relationship even though it is not necessary in the example because it is required in our actual workbook.

 

https://www.dropbox.com/s/kabeww42exurqri/Target%20Adjustment%20Sample.pbix?dl=0 

 

Thanks

2 REPLIES 2
shep123
Helper I
Helper I

I think there is some confusion because that doesn't accomplish what I need. I have to have a many-many relationship because this is only a subset and the actual relationship is many-many. Also, I have to account for the -25 in the US subtotal and not just the grand total and not utilize a blank row.

That is why my measures are as follows:
US Target = CALCULATE(SUM('Product Targets'[Target]), ALL(Products[Product]))

 
Targets (Actual) =
VAR us_target = [US Target]
VAR prod_target = 'Product Targets'[Prod Target]
RETURN IF(SELECTEDVALUE(Products[Product]) IN {"Prod A", "Prod B", "Prod C"}, prod_target, us_target).
 
I want that US Target column to say 200 for every row so I can then use it in my Targets (Actual) formula
amitchandak
Super User
Super User

@shep123 , Your relation was many to many. I made it 1 to many and now it shows the blank row.

Please find the file attached after signature

 

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.

Top Solution Authors