Reply
Vaishali04
Helper III
Helper III

Sum of Max data in measure

Hi All,

 

I need help in  building a logic in DAX.

I have below data.

KeyCircuitInOut
AA124
AA274
BB112
BB263
BB336

 

I want to build below  table at UI. I can't create calculated  max_in_out column in backend because I am using what if parameter to modify In and out value on user input.What if parameter value can not be used in calculated column. So need to calculate max_in_out and Sum as measure.

 

KeyCircuitMax_In_OutSum of Max 
AA1411
AA2711
BB1214
BB2614
BB3614

 

Thanks & Regards

Vaishali Rathi

1 ACCEPTED SOLUTION

Hi @Vaishali04 ,

 

Incase you donot want to create a column

 

Create 2 measures

 

MAX_IN_OUT Meausre = IF(MAX('Table'[In]) >= MAX('Table'[Out]) , MAX('Table'[In]) , MAX('Table'[Out]))
 
Sum of Max = SUMX(FILTER(ALL('Table'),'Table'[Key] = MAX('Table'[Key])),[MAX_IN_OUT Meausre])
 
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

2 REPLIES 2
harshnathani
Community Champion
Community Champion

Hi @Vaishali04 ,

 

1.jpg

 

 

Create a Column

 

MAX_IN_OUT = IF('Table'[In] >='Table'[Out] , 'Table'[In] , 'Table'[Out])

 

Create a measure

Measure = SUMX(FILTER(ALL('Table'),'Table'[Key] = MAX('Table'[Key])),'Table'[MAX_IN_OUT])

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

Hi @Vaishali04 ,

 

Incase you donot want to create a column

 

Create 2 measures

 

MAX_IN_OUT Meausre = IF(MAX('Table'[In]) >= MAX('Table'[Out]) , MAX('Table'[In]) , MAX('Table'[Out]))
 
Sum of Max = SUMX(FILTER(ALL('Table'),'Table'[Key] = MAX('Table'[Key])),[MAX_IN_OUT Meausre])
 
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)