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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
kasiaw29
Resolver II
Resolver II

Getting the right value based on condition

Hi community,

 

I need your help with a little dax. I'm trying to get the right value based on the result from another column. 

I have a table that generally summarizes project budgets, table has number of lines per projects with different version id's. 

I will only be using 3 specific ones for my condition - in this example A1,B1,C1. 

I want a statement to return me values from the latest version id. 

 

I though a simple nested if would do the job but it just sums all values regardles of it being A1 or B1. 

 

This is my sample data: 

 

ProjectVersion IDValue
Project AA1150,000
Project AB1174,500
Project BA188,500
Project BB1120,00
Project BC1135,200
Project AC1201,500
Project CA150,000
Project CB1

68,000

 

So from above table desired result would be: 

 

Project A - 201,500

Project B - 135,500

Project C - 68,000

 

Can anyone help? This seems simple enough but I just cannot get it. 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kasiaw29 , Create a measure like

 

measure = calculate(sum(Table[Value]), filter(Table,Table[ Version ID] = calculate(max(Table[Version ID]), allexpcept(Table,table[Project]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@kasiaw29 , Create a measure like

 

measure = calculate(sum(Table[Value]), filter(Table,Table[ Version ID] = calculate(max(Table[Version ID]), allexpcept(Table,table[Project]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey,

 

Thanks for this! I had to rank my version id's as apart from the ones that needed to be considered I had others as well that were not to be counterd, but your solution worked for me. 

 

Thanks so much! 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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