Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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?
Solved! Go to Solution.
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.
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?