Forum Discussion
Measure for Percentage difference
Hi everyone
Please could someone help me with a measure
I need to calculate the percentage difference between two status's ( on track = 1 and at risk = 2)
Calculation
Total number % number of green(1) = percentage of green
Total number % total number of red (2) = percentage of red
percentage of green minus percentage of red = total score
Data Stucture
Tatble name : RAG status
Column 1 : Item
Column 2 :Status
Column 3: Score
Thanks in advance
Z
Zaynah16 I'm not sure what do you mean by 'percentage total score' π
Anyway I took a guess, maybe this will anyway show you the way:_Measure = VAR _pct_on_track = DIVIDE( CALCULATE( SUM(RAG status[Score]), RAG status[Status] = "On Track" ), CALCULATE( SUM(RAG status[Score]), REMOVEFILTERS(RAG status[Status]) ) ) VAR _pct_at_risk = DIVIDE( CALCULATE( SUM(RAG status[Score]), RAG status[Status] = "At Risk" ), CALCULATE( SUM(RAG status[Score]), REMOVEFILTERS(RAG status[Status]) ) ) RETURN _pct_on_track - _pct_at_risk
6 Replies
- Zaynah16Helper I
Sample data - i need a dax calc/ measure to calculate the percentage score.
eg.
289 items
79 are on track
60 are at risk
I need a percentage total score of the on track minus at risk
PILLAR Business Unit Section Sub Section Item Status Score On track 1 On track 1 On track 1 Lagging 2 Lagging 2 Lagging 2 Lagging 2 No data 0 No data 0 No data 0 No data 0 At risk 3 At risk 3 At risk 3 At risk 3 At risk 3 At risk 3 - SpartaBICommunity Champion
Zaynah16 I'm not sure what do you mean by 'percentage total score' π
Anyway I took a guess, maybe this will anyway show you the way:_Measure = VAR _pct_on_track = DIVIDE( CALCULATE( SUM(RAG status[Score]), RAG status[Status] = "On Track" ), CALCULATE( SUM(RAG status[Score]), REMOVEFILTERS(RAG status[Status]) ) ) VAR _pct_at_risk = DIVIDE( CALCULATE( SUM(RAG status[Score]), RAG status[Status] = "At Risk" ), CALCULATE( SUM(RAG status[Score]), REMOVEFILTERS(RAG status[Status]) ) ) RETURN _pct_on_track - _pct_at_risk- Zaynah16Helper I
Thank you! This worked!