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.
Hi
I am new to DAX and I would like to know how I can fix this
I have the following sample dataset
ID | X | Y | Length |
1 | 0.321 | False | 100 |
1 | 0.375 | False | 150 |
1 | 0.425 | False | 200 |
1 | 0.257 | TRUE | 275 |
1 | 0.309 | False | 300 |
1 | 0.2948 | False | 125 |
1 | 0.2806 | TRUE | 95 |
2 | 0.2664 | False | 225 |
2 | 0.2522 | False | 205 |
2 | 0.238 | False | 210 |
2 | 0.2238 | False | 215 |
2 | 0.2096 | False | 219 |
2 | 0.1954 | False | 224 |
3 | 0.1812 | TRUE | 229 |
3 | 0.167 | False | 234 |
3 | 0.1528 | False | 239 |
3 | 0.1386 | False | 243 |
3 | 0.1244 | False | 248 |
4 | 0.1102 | True | 253 |
4 | 0.096 | True | 258 |
4 | 0.0818 | True | 262 |
4 | 0.0676 | False | 267 |
4 | 0.0534 | False | 272 |
4 | 0.0392 | False | 277 |
and I would like to know how to create the following grid using DAX
ID | X | Length |
1 | 0.309 | 370 |
2 | 0.2664 | - |
3 | 0.1244 | 229 |
4 | 0.0392 | 773 |
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.
Solved! Go to Solution.
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)
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)
Thanks Zubair for your help, it is really appreciated 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |