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

Measures work fine but the totals are all wrong

Hi Experts

I have a table as below, where the measures work well on their own but the totals are wrong in different ways.

After checking relevant posts here I'm sure that there must be something wrong with my coding below, but indeed don't know how to modify it, limited by my coding capability.  Thanks for your help in advance!

Measures details:

Reserve@GC = CALCULATE(SUM(TotalReserve[Total Value (GC)]),FILTER(TotalReserve,TotalReserve[Type]="Reserve"))
Reserve@GC-1 = CALCULATE(SUM(TotalReserve[Total Value (GC)]),PREVIOUSMONTH('TIME'[MonthDate]),TotalReserve[Type]="Reserve")
Scrapped@GC = CALCULATE(SUM(TotalReserve[Total Value (GC)]),FILTER(TotalReserve,TotalReserve[Type]="Scrap"))
P&L@GC = [Reserve@GC]-[Scrapped@GC]-[Reserve@GC-1]

yamacha_0-1616754514171.png

Raw Table

yamacha_2-1616754657527.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

sumx(values(Table[Month Year]),[Reserve@GC]-[Scrapped@GC]-[Reserve@GC-1])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

sumx(values(Table[Month Year]),[Reserve@GC]-[Scrapped@GC]-[Reserve@GC-1])

Anonymous
Not applicable

Thanks Amit like always. 

The one with your new measure now looks good.

But the highlighted column still return the value of the top row. I guess a SUMX shall fix it too, but tried couple of times and see all failed.

The details of this measure
Reserve@GC-1 = CALCULATE(SUM(TotalReserve[Total Value (GC)]),PREVIOUSMONTH('TIME'[MonthDate]),TotalReserve[Type]="Reserve")

yamacha_0-1616986532863.png

 

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.