Forum Discussion
Dynamic value lookup
- 6 years ago
Hi, Anonymous
Based on your decription, I created data to reproduce your scenario. The pbix file is attached in the end.
Keyword:
Calendar(a calculated table):
Calendar = CALENDARAUTO()There is no relationship between two tables. You may create a measure as below.
Visual Control = var _date = SELECTEDVALUE(Keytword[Date]) var _keyword = SELECTEDVALUE(Keytword[Keyword]) return IF( _date in DISTINCT('Calendar'[Date])&& COUNTROWS( FILTER( ALL(Keytword), NOT(Keytword[Date] in DISTINCT('Calendar'[Date]))&& Keytword[Keyword] = _keyword ) )=0, 1,0 )Finally you need to put the measure in the visual level filter and use the 'Date' column from 'Calendar' table to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
Based on your decription, I created data to reproduce your scenario. The pbix file is attached in the end.
Keyword:
Calendar(a calculated table):
Calendar = CALENDARAUTO()
There is no relationship between two tables. You may create a measure as below.
Visual Control =
var _date = SELECTEDVALUE(Keytword[Date])
var _keyword = SELECTEDVALUE(Keytword[Keyword])
return
IF(
_date in DISTINCT('Calendar'[Date])&&
COUNTROWS(
FILTER(
ALL(Keytword),
NOT(Keytword[Date] in DISTINCT('Calendar'[Date]))&&
Keytword[Keyword] = _keyword
)
)=0,
1,0
)
Finally you need to put the measure in the visual level filter and use the 'Date' column from 'Calendar' table to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks v-alq-msft for the detailed solution. It is exactly what I need. !!