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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Latest ID result on Matrix total values

Hello Power BI,

 

I need to dsiplay the latest ID record from an specific column on the totals row. I have done this before with dates but this time I only have ID number.

rit1ju_1-1634918310042.png

Thanks for your support.

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can clearly understand your requirement, and I created some test data to achieve your requirement, you can create a new measure like this to replace the original measure [Sum of Scrap percentage] in the matrix:

This is the test data I created:

vrobertqmsft_0-1635501699883.png

 

Sum of Scrap percentage1 =

var _ID=CALCULATE(MAX('Table'[ID]),FILTER(ALL('Table'),[Customer]=MAX('Table'[Customer])))

var _sum=CALCULATE([Sum of Scrap percentage],FILTER(ALL('Table'),[ID]=_ID&&[Customer]=MAX('Table'[Customer])))

return

SWITCH(

    TRUE(),

    ISINSCOPE('Table'[Customer])&&ISINSCOPE('Table'[ID]),[Sum of Scrap percentage],

    ISINSCOPE('Table'[Customer])&&NOT(ISINSCOPE('Table'[ID])),_sum)

 

 

And you can get what you want, like this:

vrobertqmsft_1-1635501699888.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can clearly understand your requirement, and I created some test data to achieve your requirement, you can create a new measure like this to replace the original measure [Sum of Scrap percentage] in the matrix:

This is the test data I created:

vrobertqmsft_0-1635501699883.png

 

Sum of Scrap percentage1 =

var _ID=CALCULATE(MAX('Table'[ID]),FILTER(ALL('Table'),[Customer]=MAX('Table'[Customer])))

var _sum=CALCULATE([Sum of Scrap percentage],FILTER(ALL('Table'),[ID]=_ID&&[Customer]=MAX('Table'[Customer])))

return

SWITCH(

    TRUE(),

    ISINSCOPE('Table'[Customer])&&ISINSCOPE('Table'[ID]),[Sum of Scrap percentage],

    ISINSCOPE('Table'[Customer])&&NOT(ISINSCOPE('Table'[ID])),_sum)

 

 

And you can get what you want, like this:

vrobertqmsft_1-1635501699888.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

@Anonymous Seems like MM3TR&R: (1) Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.