Forum Discussion

uie79957's avatar
uie79957
Regular Visitor
4 years ago

KPI Visual Values - Actual Month, Target Year

Hi all,

 

I am stuck with following situation:

I have little measure which calculates a yearly budget value in % - which works just fine.
Target Visualization: The actual values for each month are displayed in a KPI Visual, which will be filtered according to the month selected in a Slicer on the page. The Target value should be the one from the measure, but should not be changed by the slicer, as the yearly % target is equal the monthly % target. Now, when applying the slicer, the target value is totally messed up.

 

Would be very glad if somebody can assist!

 

 

 

 

 

NQC Budget % = 
VAR ManufacturingCosts = SUM(NQC_controlling_budget[MC [k€]]])
VAR Budget = SUM(Budget_NQC[NQC [k€]]])
RETURN
DIVIDE(Budget,ManufacturingCosts,0)

 

 

 

 

Cheers!

2 Replies

  • uie79957 ,

    You need to have measure like

    This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))

     

     

    assuming the target is also joined to the date table

    Also, refer

    Distributing/Allocating the Yearly Target(Convert to Daily Target): Measure ( Daily/YTD): Magic of CLOSINGBALANCEYEAR With TOTALYTD/DATESYTD: https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Yearly-Target-Convert-to/ba-p/1476400

  • uie79957's avatar
    uie79957
    Regular Visitor

    amitchandak Thank you very much, that worked very well! But considering only on year. I also have a year slicer. How I have to modify the Code whenI need to filter for different Years, but not for months?? E.g. the target values for 2021,2023 etc. are diffrent, but within the year they stay the same.

     

    This is how it's looking right now:

     

     

    NQC Budget % = 
    VAR ManufacturingCosts = CALCULATE(SUM(NQC_controlling_budget[MC [k€]]]),filter(ALL('Calendar'),'Calendar'[Date].[Year]=MAX('Calendar'[Date].[Year])))
    VAR Budget = CALCULATE(SUM(Budget_NQC[NQC [k€]]]),filter(ALL('Calendar'),'Calendar'[Date].[Jahr]=MAX('Calendar'[Date].[Year])))
    RETURN
    DIVIDE(Budget,ManufacturingCosts,0)