Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
requirement:
left side visual is what by default we get in PBI
what I need is right side visual but the values of all region should not be 0.31 rather
apac - 1
europe - 0.5
la - 0.5
afracia - 1
australia - 1
na - 1
uae - 0
only apac, europe and la have both numerator and denominator so it should give respective values
uae only has denominator so it is 0 (0/anything)
rest regions doesn't have data so it should give value as 1
-----------------------------------------------------------------------------------------------------------------------
dax:
mk | region | inclusion flag | success |
1 | apac | y | 95 |
1 | europe | n | 85 |
1 | la | y | 91 |
1 | na | n | 97 |
1 | africa | n | 88 |
1 | australia | n | 95 |
1 | apac | y | 93 |
2 | europe | y | 94 |
2 | la | n | 89 |
2 | na | n | 88 |
2 | africa | n | 99 |
2 | australia | n | 80 |
2 | uae | n | 90 |
region
region |
apac |
europe |
la |
na |
africa |
australia |
uae |
month
mk | m |
1 | nov |
2 | dec |
Hi @animebuff ,
Please try the following DAX formula, the RELATEDTABLE function can be used to ensure that the measure is calculated correctly in the region table:
New dax =
VAR _count_flag=IF(CALCULATE(COUNTROWS(RELATEDTABLE('s rate')),'s rate'[inclusion flag]="y")<>0,CALCULATE(COUNTROWS(RELATEDTABLE('s rate')),'s rate'[inclusion flag]="y"),0)
VAR _y_region_count = COUNTROWS(RELATEDTABLE('s rate'))
RETURN
DIVIDE(_count_flag,_y_region_count)
Result:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-linhuizh-msft thanks for the reply,
still it didn't met the requirement, I gave count as example but I need is distinct count and the other issue is africa, australia and na should show 1 since both numerator and denominator is not available for these countries and only uae should show 0 since numerator is 0 for uae
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
48 |
User | Count |
---|---|
215 | |
90 | |
83 | |
67 | |
59 |