Forum Discussion
aishaakhter18
2 years agoHelper I
Percentage Calculation in Power BI
I need to calculate the percentage based on the number of programs with a "Yes" response and how many are planned or have a "No" response. However, the challenge is that each program consists of mult...
aishaakhter18
2 years agoHelper I
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
aishaakhter18
2 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 it
One 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 now
take total Number of Insight divide by total # of Yes response and that not I am looking for
Its should give percentage again total # of programs like this :
Total # of prog (distinct values) divide by total # of Yes response to give me right percentage
how to fix this
Dax # 1
RA Insigts Yes Count = COUNTROWS(
SUMMARIZE(
FILTER('my tabel', 'my table[Insights for RA] = "Yes"),
'my tabler'[PROGRAM]
)
)
Dax # 2
RA 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]
)
)