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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Petr__
Helper II
Helper II

Impacting related slicers with DAX

Hello,

 

I have following data model (fixed, cannot used both direction filters that solves my issue )

data model.png

 

And my goal is to create report with 2 slicers (date and location) with condition that one slicer will involve second one (keep condition that current data model fix)

so if I will choose range of values, then range of location will be also changes (based on the date range)

 

I tried to put DAX field into location slicer, but it doesnt help, my guess was something like that:

 

SlicerDate = CALCULATETABLE(Location, USERELATIONSHIP(Sales[ID_Date],'Date'[ID]))
 
but getting error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
 
so may 2 questions
1) is it possible calculate dax measure and then assign it for slicer ?
2) If yes, what s the correct formula ? If no why I got this error it weird when calculatetable doesn t return table
 
thanks !!!
3 REPLIES 3
SivaMani
Resident Rockstar
Resident Rockstar

@Petr__ , If I understand correctly, you wanted to have your slicers interact with each other. Slicers won't support measures. But I have a workaround,

  • Create a measure,
IsLocationHasSales = CALCULATE(COUNT(Sales[ID_Location]),CROSSFILTER(Sales[ID_Location],Location[ID_Location],Both))
  • Add this measure as a visual filter to Location Slicer and filter >= 1

SivaMani_0-1709588742219.png

 

Hope this helps!

 

Hi @SivaMani ,

 

unfortunatelly it doesn t work, I create measure as you mention,

but I don t understand what you mean by "Add this measure as a visual filter to Location Slicer" you wrote that slicers doesn t support measures therefore I dont t know where to assign it, for filter I set up it correctly

thanks 🙂

@Petr__  Select the slicer that has the Location Column added and drag the measure to Filter on this visual section in the filter pane as shown below,

SivaMani_0-1709651282623.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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