Forum Discussion
julesdude
4 years agoPost Partisan
Pie Chart Problems - Can't Add Values for Totals Using Last Date Only
Hi there, Edit to my original post as it wasn't clear! I'm having difficulty getting my pie chart to work. I have a source table that's like this: Last Updated Country Asset Reference T...
- 4 years ago
Hi, julesdude ;
You could create a measure.
total = var _max=CALCULATE(MAX('TableA'[Date]),ALLEXCEPT(TableA,'TableA'[Country])) return CALCULATE(SUM('TableB'[Total Value]),FILTER(TableB,[Date]=_max))The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TheoC
4 years agoCommunity Champion
Hi julesdude
Okay, I am hoping based on all the back and forths, this is the right outcome you are wanting:
Basically, the measure is saying to only return the Amount for the Country and Asset Reference if the date is the Last Date, and then make everything else disappear (just from the table visual).
Measure =
VAR _0 = LASTDATE ( 'Table'[Date] )
VAR _1 = CALCULATE ( LASTDATE( 'Table'[Date] ) , ALLEXCEPT ( 'Table' ,'Table'[Country] ,'Table'[Asset Reference] ) )
VAR _2 = IF ( _1 = _0 , SUM ('Table'[Amount] ) , BLANK() )
RETURN
_2
After you shared the new data, it became a lot easier to follow. PBIX is attached.
Please mark this as the correct solution if it is what you're after!
Thanks heaps,
Theo