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 Experts.
Hope u all are having a great day.
Can you please help me with the correct DAX in order to get the desired result?
I need to get the Reject % for each country. Let's say for Egypt, I need to get the result of 3.57%. That is 2/56
Volume of Reject vs Total Volume per Medal.
Results must be:
Egypt = 3.57% (2 divided 56)
GDS Argetina = 0% (0 divided by 56)
GDS India = 23.21% (13 divided by 56)
and so on..
Period | Medal | Country | Reject | Total Volume | Result should be: |
Aug-22 | Gold | All | 20 | 56 | |
Egypt | 2 | 2 | 3.57% | ||
GDS Argentina | 0 | 1 | 0.00% | ||
GDSIndia | 13 | 28 | 23.21% | ||
GDS Poland | 2 | 2 | 3.57% | ||
Greece | 0 | 2 | 0.00% | ||
India | 2 | 6 | 3.57% | ||
Pakistan | 0 | 2 | 0.00% | ||
Poland | 0 | 2 | 0.00% | ||
United Kingdom | 0 | 2 | 0.00% | ||
United States | 1 | 7 | 1.79% | ||
Zimbabwe | 0 | 2 | 0.00% |
Let me know if you need more information. thank you 🤗
Solved! Go to Solution.
Hi Pablo, Thanks for the reply.
I tried below measure and I got the expected result. Appreciate the time and effort you put in. ❤️
Expected result measure: =
DIVIDE (
SUM ( 'TableName'[Reject] ),
CALCULATE ( SUM ( 'TableName'[Volume] ), ALL ( 'TableName'[Country] ) )
)
Hi @Newbie22 !
Your DAX should be something like this:
Reject % =
VAR _CurrentReject = [Reject]
VAR _Volume =
CALCULATE(
[Total Volume],
ALLSELECTED( Country )
)
RETURN
DIVIDE(
_CurrentReject,
_Volume
)
Let me know if that helps!
Hi Pablo, Thanks for the reply.
I tried below measure and I got the expected result. Appreciate the time and effort you put in. ❤️
Expected result measure: =
DIVIDE (
SUM ( 'TableName'[Reject] ),
CALCULATE ( SUM ( 'TableName'[Volume] ), ALL ( 'TableName'[Country] ) )
)
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 |
---|---|
105 | |
96 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |