The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi Coaches,
I am new to Power BI.
I have 3 columns - Model ID, Materiality, RAG status
I am able to achieve the count of model IDs that have materiality-high, and RAG status- Green
However, the ask is to get the percentage as a KPI card which I am struggling with.
In the above image, count of model IDs that are green and have materiality- high is 25.
and same is shown in percentage as 68%.
This percentage KPI is stand alone, and I am not able to achieve this.
PLease help me with this.
@parry2k @amitchandak @Ritaf1983 @Ahmedx
Solved! Go to Solution.
You'll want to ensure you have the Filter context the same for both items in your KPI (which it doesn't look like there is). One way to do that is to ensure that your averages are calculated at the right grain. Judging by your Matrix visual - and understanding this as a % of the total population you'll want some DAX in a measure that is something to this effect :
KPI Measure =
VAR _GreenAndHigh = FILTER(
'YourTable',
'YourTable'[RAG Status] = "Green" && 'YourTable'[Materiality] = "High"
)
VAR _GreenHighCount = COUNTROWS(_GreenAndHigh)
VAR _TotalPop = COUNTROWS('YourTable')
VAR _Result = DIVIDE(_GreenHighCount, _TotalPop)
RETURN
_Result
Side note - make sure you actually have your API filtered to the timeframe you have in the header "Apr-23", else you'll be missing context.
Can you upload the pbix file?
You'll want to ensure you have the Filter context the same for both items in your KPI (which it doesn't look like there is). One way to do that is to ensure that your averages are calculated at the right grain. Judging by your Matrix visual - and understanding this as a % of the total population you'll want some DAX in a measure that is something to this effect :
KPI Measure =
VAR _GreenAndHigh = FILTER(
'YourTable',
'YourTable'[RAG Status] = "Green" && 'YourTable'[Materiality] = "High"
)
VAR _GreenHighCount = COUNTROWS(_GreenAndHigh)
VAR _TotalPop = COUNTROWS('YourTable')
VAR _Result = DIVIDE(_GreenHighCount, _TotalPop)
RETURN
_Result
Side note - make sure you actually have your API filtered to the timeframe you have in the header "Apr-23", else you'll be missing context.
@Erokor Thank you so much for the quick help. With your DAX expression, I was able to achieve the rquiremnet with some little changes here & there.
Kudos!!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
94 | |
80 | |
63 | |
56 |
User | Count |
---|---|
248 | |
122 | |
110 | |
77 | |
70 |