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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.