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.
Dear Community,
I am very new to power BI. This could be simple requirement but I am struggling to make it work.
Here is my requirement :
DAX to calculate dynamically within group.
Type | EMPLID | Calculation | expected result |
CTA | 1001 | distinct emplid/ count(type) | 0.33 |
Generic | 1001 | distinct emplid/ count(type) | 0.33 |
1001 | distinct emplid/ count(type) | 0.33 | |
XYZ | 1002 | distinct emplid/ count(type) | 1.00 |
I have Type slicer on the report page and when I select ex: Type ->CTA, Generic then expected result is
Type | EMPLID | Calculation | expected result |
CTA | 1001 | distinct emplid/ count(type) | 0.50 |
Generic | 1001 | distinct emplid/ count(type) | 0.50 |
1001 | distinct emplid/ count(type) | ||
XYZ | 1002 | distinct emplid/ count(type) |
Please help.
Thanks,
Solved! Go to Solution.
@vishwa_sg
measure = divide(distinctcount(emplid), calculate(distinctcount(type), allselected(type)))
@vishwa_sg Here is a link to download a sample solution file:
DAX to calculate dynamically within Selected Group 2022-08-10.pbix
Hi @SpartaBI Thank you so much.
By using your formula. I managed to achieve the expected result. Have to calculate within a group and here is the working DAX
@my pleasure 🙂
P.S. Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. Please give it a thumbs up over there if you liked it 🙂https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
@vishwa_sg
measure = divide(distinctcount(emplid), calculate(distinctcount(type), allselected(type)))
@vishwa_sg Here is a link to download a sample solution file:
DAX to calculate dynamically within Selected Group 2022-08-10.pbix
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
42 | |
39 | |
19 | |
19 |