Forum Discussion
Anonymous
2 years agoNot applicable
Ratio Calculation
Hello, I need some assistance here. I have below sample data. I need to find out the ratio between two status of the issue. Needed output is ration between the types of issue (but only between Pa...
- Anonymous2 years ago
Hi Anonymous ,
Based on your problems, here are my answers.
First I created a table based on your description.
Then created four Measure.
Total Hardware Issues = SUMX(FILTER('Table', 'Table'[Type Of Issue] = "Hardware"), 1)Total Parts Issues = SUMX(FILTER('Table', 'Table'[Type Of Issue] = "Parts"), 1)Issue Ratio = DIVIDE([Total Hardware Issues], [Total Parts Issues])Ratio Display = (CONCATENATE("1:", [Issue Ratio]))Finally you will see the result you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jihwan_Kim
Super User
2 years agoHi,
I am not sure about how your semantic mode looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
KEEPFILTERS function (DAX) - DAX | Microsoft Learn
Issue count % only hardware + parts: =
VAR _countall =
COUNTROWS (
CALCULATETABLE (
Data,
'Type Of Issue'[Type Of Issue] IN { "Hardware", "Parts" }
)
)
VAR _count =
COUNTROWS (
CALCULATETABLE (
Data,
KEEPFILTERS ( 'Type Of Issue'[Type Of Issue] IN { "Hardware", "Parts" } )
)
)
RETURN
DIVIDE ( _count, _countall )