Hi all,
I have a model that has a value amt. These are categorised and each category has its own kpi target %. The % add up to 100%
I'm tracking the actual % using:=sum(amt grouped by category)/calculate(sum(amt),all(tbl))
The first category target is the MINIMUM it needs to hit. The remainder are the MAXIMUM
Here's how it's working now. The 1st row should be green because 74.4>70.0
but i'm not sure how i can get this working.
here's what i mean. Unpaid status is what i have now, the should be is what i want it to show.
my fact is (categoryid,amount), my dimcategory is (categoryid,targetpercentage) - target % as shown above
my measures are
AllUnpaid:=sum(fact[amount])/calculate(sum(fact[amount]),ALL(fact))
- this gives me the actual %
targetPercenage:=sum(targetpercentage)
- this gives me the target %
I then set up the KPI on AllUnpaid and use targetpercentage as the calc column.
I have the following hack working, but it seems like a very roundabout way of doing things and i need to have two measures. one for actual % and a dummy 1/0 for the KPI
step 1. get the subtotal per category as a column on my fact table
=CALCULATE(SUM([amt]), FILTER('fact, 'fact'[CategoryID]=EARLIER('fact'[CategoryID]) ) )
step 2. get the subtotal as % of grand total as a column on the fact
=[CalculatedColumn1]/sum([amt])
step 3. drag across the target % as a column on the fact
=related('Aged Debtor Band'[TargetPercentage])
step 4. case statement. Sets KPI to true if % >= target for categoryid 1. The remainder must be below the target to get 1
=switch(true, AND([CategoryID]=1,[CalculatedColumn2]>=[CalculatedColumn3]),1, AND([CategoryID]<>1,[[CalculatedColumn2]<=[CalculatedColumn3]),1,0)
add kpimet:=max(calculatedcolumn4) measure and set absolute kpi on it.
It works but now i have all this nonsense in my model and I have my actual %, target % and kpi status as separate measures whereas logically they should all be different properties of the same measure.
Thanks
just wondering if there's a better way?