Forum Discussion
Calculated Measures and charts
Hi,
Please find attached data for KPI dashboard:
I am struggling to calculate current month star rating
Ex: unable to pull star rating for one KPI where KPI no="5.1.1 Actual" , Date = current month (Date Table)
Any better way to data model?
Thank you.
- Anonymous2 years ago
Hi rajendraongole1 ,Thanks for your quick reply, I will add more.
Hi swathrddy ,
Please follow these steps:
1.Unpivot the selected columns
2.Use the following DAX expression to create a table for slicer
Table 2 = CALCULATETABLE(VALUES('Table'[KPI No]),'Table'[Indicators Description] <> "Target")3.Use the following DAX expression to create a column
Date = EOMONTH([Attribute],0)4.Use the following DAX expression to create measures
CurrentMonthKPI = VAR _slicer = VALUES ( 'Table 2'[KPI No] ) VAR _table = FILTER ( 'Table', 'Table'[KPI No] IN _slicer && DATE ( YEAR ( 'Table'[Attribute] ), MONTH ( 'Table'[Attribute] ), 1 ) = DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ) ) RETURN CONCATENATEX ( _table, [Value], UNICHAR ( 10 ) )PreviousMonthKPI = VAR _slicer = VALUES ( 'Table 2'[KPI No] ) VAR _table = FILTER ( 'Table', 'Table'[KPI No] IN _slicer ) RETURN CONCATENATEX ( _table, [Value], UNICHAR ( 10 ) )5.Final output
Since there is no data for July in the table, it is displayed as 'Blank'. At the same time, I set a relative date for the 'Table' visual .
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- rajendraongole1
Super User
Hi swathrddy - Can you please share more information about with sample data/ pbix file, that helps to understand the problem
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!- swathrddy
Helper I
Hi rajendraongole1,
Please find the data table.
I am trying to create a KPI dashboard with gauge chart for current month scores and trend lines to show rolling 6 months. Data has different Targets, like Scale(1-5), Percentage and numbers with "Higher the better" or "Lower the better".
Please let me know if you need me to share anything else.
Regards!!
Order KPI KPI No Indicators Description Target Type Target Guage Oversight Department Next assesment due date Report Frequency Jan-24 Feb-24 Mar-24 Apr-24 May-24 Jun-24 Offer a range of options and identify opportunities that will improve person Centered care and choice PROVIDER OF CHOICE 1.1.1 Acutal % of consumer feedback has been answered and responded to withing 5 working days Percentage higher is better AAA Governance 1/08/2024 Monthly 62% 54% 57% 38% 53% 67% Offer a range of options and identify opportunities that will improve person Centered care and choice PROVIDER OF CHOICE 1.1.1 Target Target Percentage higher is better AAA Governance 1/08/2024 Monthly 90% 90% 90% 90% 90% 90% Board and Executive maintains an appropriate level of industry knowledge, diversity and skill to ensure quality governance. LEADERSHIP AND GOVERANCE 2.1.1 Actual Board membership monitored and gaps reported to Chair at a minimum of annually. Months since last review Yes/No target met AAA Governance Monthly Yes Yes Yes Yes Yes Yes Board and Executive maintains an appropriate level of industry knowledge, diversity and skill to ensure quality governance. LEADERSHIP AND GOVERANCE 2.1.1 Target Target Yes/No target met AAA Governance Monthly Yes Yes Yes Yes Yes Yes Maintain a positive and values-based workforce and working environment. OUR PEOPLE 3.1.1 Actual Number of values nomination on Google Number higher is better DDD Governance Monthly 33 14 15 6 7 20 Maintain a positive and values-based workforce and working environment. OUR PEOPLE 3.1.1 Target Target Number higher is better DDD Governance Monthly 20 20 20 20 20 20 Maintain a positive and values-based workforce and working environment. OUR PEOPLE 3.1.3 Actual Number of new workers comp claims in month Number lower is better AAA Governance Monthly 0 1 0 0 1 0 Maintain a positive and values-based workforce and working environment. OUR PEOPLE 3.1.3 Target Target Number lower is better AAA Governance Monthly 0 0 0 0 0 0 Maintain a positive and values-based workforce and working environment. OUR PEOPLE 3.1.4 Actual LTI Residential Percentage lower is better AAA Governance Monthly 15% 20% 30% 10% 17% 20% Maintain a positive and values-based workforce and working environment. OUR PEOPLE 3.1.4 Target Target Percentage lower is better AAA Governance Monthly 17% 17% 17% 17% 17% 17% Ensure Company is a financially viable and sustainable organisation . SUSTAINABILITY 4.1.1 Actual Budget is maintained within acceptable variance Percentage higher is better CCC Governance Monthly 192% 141% 40% 179% 278% Ensure Company is a financially viable and sustainable organisation . SUSTAINABILITY 4.1.1 Target Target Percentage higher is better CCC Governance Monthly 10% 10% 10% 10% 10% 10% Grow Company's services through partnerships, alliances and identification that will result in an extension of services SUSTAINABILITY 4.2.1 Actual Engagement by leadership team with external stakeholders Number higher is better Leadership Team Governance Monthly 2 2 5 2 6 4 Grow Company's services through partnerships, alliances and identification that will result in an extension of services SUSTAINABILITY 4.2.1 Target Target Number higher is better Leadership Team Governance Monthly 2 2 2 2 2 2 Ratings STAR RATING 5.1.1 Actual Star Rating - Overall (Residential) Scale (1-5) higher is better AAA Governance Quarterly 4 4 4 4 4 4 Ratings STAR RATING 5.1.1 Target Target Scale (1-5) higher is better AAA Governance Quarterly 3 3 3 3 3 3
- AnonymousNot applicable
Hi rajendraongole1 ,Thanks for your quick reply, I will add more.
Hi swathrddy ,
Please follow these steps:
1.Unpivot the selected columns
2.Use the following DAX expression to create a table for slicer
Table 2 = CALCULATETABLE(VALUES('Table'[KPI No]),'Table'[Indicators Description] <> "Target")3.Use the following DAX expression to create a column
Date = EOMONTH([Attribute],0)4.Use the following DAX expression to create measures
CurrentMonthKPI = VAR _slicer = VALUES ( 'Table 2'[KPI No] ) VAR _table = FILTER ( 'Table', 'Table'[KPI No] IN _slicer && DATE ( YEAR ( 'Table'[Attribute] ), MONTH ( 'Table'[Attribute] ), 1 ) = DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ) ) RETURN CONCATENATEX ( _table, [Value], UNICHAR ( 10 ) )PreviousMonthKPI = VAR _slicer = VALUES ( 'Table 2'[KPI No] ) VAR _table = FILTER ( 'Table', 'Table'[KPI No] IN _slicer ) RETURN CONCATENATEX ( _table, [Value], UNICHAR ( 10 ) )5.Final output
Since there is no data for July in the table, it is displayed as 'Blank'. At the same time, I set a relative date for the 'Table' visual .
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.