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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
IslamAbdelhalim
Frequent Visitor

DAX Formula Help

Hi 

I am new to DAX and I would like to know how I can fix this

 

I have the following sample dataset 

ID XYLength 
10.321False 100
10.375False 150
10.425False 200
10.257TRUE275
10.309False 300
10.2948False 125
10.2806TRUE95
20.2664False 225
20.2522False 205
20.238False 210
20.2238False 215
20.2096False 219
20.1954False 224
30.1812TRUE229
30.167False 234
30.1528False 239
30.1386False 243
30.1244False 248
40.1102True 253
40.096True 258
40.0818True 262
40.0676False 267
40.0534False 272
40.0392False 277

 and I would like to know how to create the following grid using DAX

ID XLength 
10.309370
20.2664-
30.1244229
40.0392773

 

Mainly what I would like to do to make a grid that has for each ID, the predominant X (X that has the biggest length) and if there are any "True" values in the Y column report the summation length of those True records otherwise report a blank.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@IslamAbdelhalim 

 

You can use these MEASURES

 

Predominant X =
CALCULATE (
    MAX ( Table1[X] ),
    FILTER ( table1, Table1[Length] = MAX ( Table1[Length] ) )
)

 

Length_ = CALCULATE(sum(Table1[Length]),Table1[Y]=true)

 


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@IslamAbdelhalim 

 

You can use these MEASURES

 

Predominant X =
CALCULATE (
    MAX ( Table1[X] ),
    FILTER ( table1, Table1[Length] = MAX ( Table1[Length] ) )
)

 

Length_ = CALCULATE(sum(Table1[Length]),Table1[Y]=true)

 


Regards
Zubair

Please try my custom visuals

Thanks Zubair for your help, it is really appreciated 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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