I have the following requirement where i am supposed to calculate the weight of each row in a table.
I need to calculate the Weight column which is 100/ count ( KPI type and KPI)
For example in below KPIType focus area is having only 1 KPI(Operation) so it would be 100/1= 100%
Similarly , KPI type BL KPI is having 4 KPI (ST,CC,SC,Spares) hence it would be 100/4 = 25% each. for KPIGroup as Reliability
Note : KPIType would have duplicates also hence we need to consider KPIGroup also in calculation.
Can someone help to find a way where i can add a calculated column for below condition. Or is there any other way we can achieve this. Thanks in Advance.
|Gen||Financials||BL Focus Area||Substainability||100%|
|Gen||Business||BL Focus Area||spend||100%|
You should be able to use EARLIER() and a few filter conditions to make it work. Try this:
Weight = DIVIDE( //divide 100, //100 by.. CALCULATE( count('Table'[KPIType]), //the number of KPI types... FILTER(ALLSELECTED('Table'), 'Table'[KPIType] = EARLIER('Table'[KPIType]) && //...of current KPI type 'Table'[KPIGroup] = EARLIER('Table'[KPIGroup]) //That also belong to the current KPIGroup ) ) )
I have similar requirement where i need to show weight based on KPI group..
But again KPI group will have KPIType, KPI,BI also into consideration.
So here the total number of KPI group / total count
|Reliability, Service Resilience & Security of Supply||20%|
|Sector/ Company Restructuring||20%|
I tried the similar way which was suggested and it is not working.
Can you please help here please.
I'm not sure I quite understand what you're looking for, could you help me expand your question?
Does the data table look the same as in the first example? But weight according to KPI group instead?
It would be great if you can have some example data and expected result as in the first case
So i will have two tables to display, the one which we saw earlier as below.
So here we need to create another table which is calculating average of individual KPI Type separately. Please see below as example.
Final Output table :
sample Formula to calculate individual Avg of reliability.
Focus area Var (From first table)=sum(0.1) = 0.1
BL KPI Var = sum (BL KPI ( (0.11+0.12+0.13+0.14)) = 0.5
Average = Avg(0.1,0.5) = 0.3
|Reliability Avg||Reliability Avg = AVERAGE( SUM (Var for Focus Area) (0.1), SUM( Var for BL KPI(ST,CC,SC,Spares)(0.11+0.12+0.13+0.14)||Average(Sum(focus Area) + Sum(BL KPI ))|
Let me know if this is clear. Thanks in advance. Please do help.
I'm still not entirely sure of what we're calculations. I don't really see how the numbers in the Average column in the Output table are averages.
But I made an attempt at recreating the Final Output table in the linked file. I hope it at least helps you coming closer to your solution. I created a new table for the output table, but it could probably be done just using measures in the original table as well, and let me know if you want me to try that road instead.
Please find below screenshot of two tables which are needed for output.
Keep in mind that there can be multiple KPIgroup , KPI , KPI type as mentioned in the initial table posted on the very first of this post. hope this helps.
I see you have taken two tables , table1 and table, But i have all the values in single table only.
In the earlier function and other functions you have taken table and not table 1.
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.