The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a bar chart and date slicer and I disabled interaction between those two. However I would like to have possibility to reference the actual value in a slicer in a measure used with the bar chart. Is there some DAX function that would allow me to achieve this?
I had a similar issue and I couldn't find an answer on this forum. In my scenario, I wanted to retrieve a selected Date while having interactions between visualizations turned off.
Here's the link that helped me greatly. The idea is to create a separate (disconnected) table with all unique Dates and use this field as a slicer. Afterwards, creating a measure with SELECTEDVALUE referencing this new Date field is very straightforward.
https://www.blue-granite.com/blog/disconnected-table-power-bi
Hi @nothingman
I think
SELECTEDVALUE (SlicerTable[SlicerColumn])
should work if you select only one value in the slicer.
The function that you've proposed doesn't work because the interaction between slicer and bar chart is turned off so SELECTEDVALUE sees all values in the date column. This is my main issue - how to get a reference to value selected on a slicer even though the interaction is turned off
Hello,
Were you able to fix this problem ? I am facing the same issue now and still can't fix it!
Thank you!
Hi @nothingman,
You can use:
If you are using the "between" option:
First selected value = CALCULATE(FIRSTDATE(DIM_DATA_2[Date]); ALLSELECTED())
Last selected value = CALCULATE(LASTDATE(DIM_DATA_2[Date]); ALLSELECTED())
If you are using the "list" option you can do like @Zubair_Muhammad said:
SELECTEDVALUE(DIM_DATA_2[Date]).
Ricardo