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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Camill88
Frequent Visitor

Year extracted from date picker can't be compared to year from DateTable

I have some easy task to do - I want to filter Date table based on year taken from date picker. Here are my measures:

 

1. Measure which extracts year from date picker

 

 

Selected Date = 
CALCULATE(
   YEAR(MAX( DateTable[Date] )),
   ALLSELECTED( DateTable[Date] )
)

 

 

2. Calculated table where I use above measure to filter Date table

 

 

VAR vSelectedDate = [Selected Date]

VAR vCustomersNotInYear =
CALCULATETABLE(
    VALUES('DateTable'[Year]),
    'DateTable'[Year] < vSelectedDate
    )
    
RETURN vCustomersNotInYear

 

 

I checked, that measure [Selected Date] returns year properly, it's a number. Year in Date table is also a number. When I change date on a picker then Calculated table doesn' react. However, when I assign years manullay e.g.:

 

 

'DateTable'[Year] = 2010

 

 

then it works fine. I also tried to explicitly enforce converting measure to number (just in case): 

 

 

VAR vSelectedDate = VALUE([Selected Date])

 

 

but it also doesn't help. Where the problem lies? 

1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

hi @Camill88 ,

 

You can reference a measure in a calculated table. But calculated table/column are not supposed to respond to the slicer actions(even any visual actions). That is the only reason behind. 

View solution in original post

2 REPLIES 2
FreemanZ
Community Champion
Community Champion

hi @Camill88 ,

 

You can reference a measure in a calculated table. But calculated table/column are not supposed to respond to the slicer actions(even any visual actions). That is the only reason behind. 

Ok, thanks. So what should I do in this case? Add calculated table to modela and establish relationship to fact table? What's the good practice here?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.