Forum Discussion
Use Measures as a Slicer
I have a map and would like to be able to add a slicer to filter to either Loss $ and Loss Volume. How do I do this?
- Anonymous1 year ago
Hi mkane12 ,
Thanks for reaching out to the Microsoft fabric community forum.
MeasuresNew measure and create the following measures:
Measure 1: Losses
Losses = CALCULATE( SUM(McLeodIQ_Operations[Projected Carrier Margin]), McLeodIQ_Operations[Win//Loss] = "1" )Measure 2: Loss Vol
Loss Vol = CALCULATE( SUM(McLeodIQ_Operations[Volume]), McLeodIQ_Operations[Win//Loss] = "1" )
Create a Disconnected Table for Measure SelectionNew table and create:
MeasureSelector = DATATABLE( "MeasureName", STRING, { {"Losses"}, {"Loss Vol"} } )This table has no relationship with your main data table , it’s just for the slicer.
Create a Dynamic MeasureCreate a new measure named Selected Measure :
Selected Measure = VAR Selected = SELECTEDVALUE(MeasureSelector[MeasureName]) RETURN SWITCH( Selected, "Losses", [Losses], "Loss Vol", [Loss Vol], BLANK() )Build the Visuals
-
Go to Insert > Map visual.
-
Drag McLeodIQ_Operations[ State ] to Location.
-
Drag SelectedMeasue to Size or Tooltips depending on how you want it visualized.
-
Add a Slicer to the canvas.
-
Use MeasureSelector[ MeasureName ] in the slicer.
Test It
Select "Losses" or "Loss Vol" in the slicer.
The map visual will update accordingly, reflecting the selected measure per state.
Please find the attached pbix for reference
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find itBest Regards,
Sreeteja.
Community Support Team -
9 Replies
- ajaybabuinturi
Super User
Hi mkane12,
You cant be able to add a measure in a Slicer. You will create a calculated column for you requirement then you can use this as a slicer.
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues. - mkane12
Helper I
the 2 measures i have are
Losses = CALCULATE(SUM(McLeodIQ_Operations[Projected Carrier Margin]),FILTER(McLeodIQ_Operations,McLeodIQ_Operations[Win//Loss]="1"))
andLoss Vol = CALCULATE([Sum of Vol],FILTER(McLeodIQ_Operations,McLeodIQ_Operations[Win//Loss]="1"))
I want to use these to filter a map and use them as a slicer.- AnonymousNot applicable
Hi mkane12 ,
Thanks for reaching out to the Microsoft fabric community forum.
MeasuresNew measure and create the following measures:
Measure 1: Losses
Losses = CALCULATE( SUM(McLeodIQ_Operations[Projected Carrier Margin]), McLeodIQ_Operations[Win//Loss] = "1" )Measure 2: Loss Vol
Loss Vol = CALCULATE( SUM(McLeodIQ_Operations[Volume]), McLeodIQ_Operations[Win//Loss] = "1" )
Create a Disconnected Table for Measure SelectionNew table and create:
MeasureSelector = DATATABLE( "MeasureName", STRING, { {"Losses"}, {"Loss Vol"} } )This table has no relationship with your main data table , it’s just for the slicer.
Create a Dynamic MeasureCreate a new measure named Selected Measure :
Selected Measure = VAR Selected = SELECTEDVALUE(MeasureSelector[MeasureName]) RETURN SWITCH( Selected, "Losses", [Losses], "Loss Vol", [Loss Vol], BLANK() )Build the Visuals
-
Go to Insert > Map visual.
-
Drag McLeodIQ_Operations[ State ] to Location.
-
Drag SelectedMeasue to Size or Tooltips depending on how you want it visualized.
-
Add a Slicer to the canvas.
-
Use MeasureSelector[ MeasureName ] in the slicer.
Test It
Select "Losses" or "Loss Vol" in the slicer.
The map visual will update accordingly, reflecting the selected measure per state.
Please find the attached pbix for reference
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find itBest Regards,
Sreeteja.
Community Support Team- AnonymousNot applicable
Hi mkane12 ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solutionand give a 'Kudos'. This will be helpful for other community members who have similar problems to solve it faster.
-