cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
IslamAbdelhalim Frequent Visitor
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

Accepted Solutions
Super User
Super User

Re: DAX Formula Help

@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)

 

View solution in original post

2 REPLIES 2
Super User
Super User

Re: DAX Formula Help

@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)

 

View solution in original post

IslamAbdelhalim Frequent Visitor
Frequent Visitor

Re: DAX Formula Help

Thanks Zubair for your help, it is really appreciated 🙂

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 169 members 1,841 guests
Please welcome our newest community members: