Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Year targets vs. Date table

Source: Tabular model 🙂

I have 'Year Target' table containing columns: Department - Date - TargetArea - Min - Mid - Max.
I have made measure for min, mid and max by TargetArea which I can use on report.
(e.g. Material Y Target max:=CALCULATE(AVERAGE('YearTarget'[Max]);'YearTarget'[TargetArea]="Material";'Year Target'[Max]<>0)

Date in this table is for 1st day of Jan in selected year (e.g. 2020-01-01, 2019-01-01 etc.). 
If I now link that date field to DimDate I will get target measures only for that month.

How to update measures so that I have correct target for 2020 even I have any of the months selected ?
And if I select any month from 2019 it shows targets for that year?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

[Good Measure] =
CALCULATE(
    AVERAGE( YearTarget[Max] ),
    // You want to wrap conditions in KEEPFILTERS
    // (almost) every time you know you're going to
    // slice and dice by the attribute involved.
    KEEPFILTERS( YearTarget[TargetArea] = "Material" ),
    YearTarget[Max] <> 0, // I would be careful with this condition...
    ALL( DimDate ),
    VALUES( DimDate[Year] )
)

 

Best

D

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

[Good Measure] =
CALCULATE(
    AVERAGE( YearTarget[Max] ),
    // You want to wrap conditions in KEEPFILTERS
    // (almost) every time you know you're going to
    // slice and dice by the attribute involved.
    KEEPFILTERS( YearTarget[TargetArea] = "Material" ),
    YearTarget[Max] <> 0, // I would be careful with this condition...
    ALL( DimDate ),
    VALUES( DimDate[Year] )
)

 

Best

D

kentyler
Solution Sage
Solution Sage

When you put this measure on a graphic (a table say) Material Y Target max:=CALCULATE(AVERAGE('YearTarget'[Max]);'YearTarget'[TargetArea]="Material";'Year Target'[Max]<>0)

then the filter context it runs it is limited to the row in the table....which is why is shows only that month

CALCULATE can change the external filter context by add an ALL argument

CALCULATE(AVERAGE('YearTarget'[Max]);'YearTarget'[TargetArea]="Material";'Year Target'[Max]<>0;ALL('YearTarget'))
or maybe ALL('YearTarget'[Max])
this will remove the filter on the YearTarget table and you should get the full average.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.