Forum Discussion
Percentage Calculation in Power BI
You are only restating part of your original post and not providing any percentages.
How does that indicate your expected results? I thought the expected results would be a percentage for each status. But you don't show how they are derived.
What if a program has, for example, status responses of "No", "Planned" and "Under Assessment" for the different Service Order #'s?
You really need to be more specific. I cannot figure out, for example, how you derive 81% as the correct answer for "Yes".
How do calculate 81% "Yes"
What result would you expect for each of the Planned / Under Assessment / No categories.
The closest I can come, trying to use your written description, is:
In my real data, i have total # number of programs = 45
- Out of 45 Programs , 37 Service Order Status Response = Yes:
- Out of 45 Programs , 16 Service Order Status Response = Under Assesment
- Out of 45 Programs , 3 Service Order Status Response = Planned
And if you take a percentahe then you will get the Chart I shared with you, In some senarios I have no so need to keep one sanario for it too
- aishaakhter182 years agoHelper I
Also I have total # of programs are 45 , and if Yes are 37 then left over that should 45-37= *, Only 8 program should be in Planned or under assesmet status, and that what I am trying to figure our how to calculate thos correctly that the prog that are already have yes ststus should not be count again for other status
- aishaakhter182 years agoHelper I
Can you help me to resolve one more thing, I will greatly appreciate this
When I am using the two DAX see below and putting it in pie chart to get the percentage, what its doing its counting the total response of RA and then taking % out of itOne col for program are and I col with for insight that have responses - yes, Planned, Under Ass, or blank. in programs col there are many duplicates and because of this for Insight col one prog may have Yes and also Planned or Under Ass.Now see the two Dax below : and what its doing nowtake total Number of Insight divide by total # of Yes response and that not I am looking forIts should give percentage again total # of programs like this :Total # of prog (distinct values) divide by total # of Yes response to give me right percentagehow to fix thisDax # 1RA Insigts Yes Count = COUNTROWS(SUMMARIZE(
FILTER('my tabel', 'my table[Insights for RA] = "Yes"),
'my tabler'[PROGRAM])
)
Dax # 2RA Insight NoPlannedUA_CountExcludeYes = COUNTROWS(
SUMMARIZE(
EXCEPT(
FILTER(
'my table','my table'[Insights for RA] IN {"No", "Planned", "Under Assessment", " "}),
FILTER(
'my table','my table'[Insights for RA] = "Yes")
),
'my table'[PROGRAM])
)