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
ssubramani
Frequent Visitor

Slicer on on measure with Mapbox visual

Hi I am trying to create a slicer on a measure [Sales Category] to filter on Mapbox visual with multiple level of drill downs.

 

The Slicer is not  filtering the data on the map.

Below are the steps I have followed.

1) Create a disconnected table, with two columns, one with Slicer Measure (holds 3 category : C1 , C2, C3) and  slicer value (1,2,3).

2) Create 3 measures 

C1 = IF(
SELECTEDVALUE(SlicerTable[SlicerValue]) = 1
|| ISBLANK(SELECTEDVALUE(SlicerTable[SlicerValue])),
[Sales Category]
)
 
C2 = IF(
SELECTEDVALUE(SlicerTable[SlicerValue]) = 2
|| ISBLANK(SELECTEDVALUE(SlicerTable[SlicerValue])),
[Sales Category]
)
 
C3 = IF(
SELECTEDVALUE(SlicerTable[SlicerValue]) = 3
|| ISBLANK(SELECTEDVALUE(SlicerTable[SlicerValue])),
[Sales Category]
)
 
Where [Sales Category] mesaure is the derived measure based on sales percentage as C1/ C2 / C3 based on the sales amount with respect to the location of sales. 
 
Currently the Slicer is not functionioning on the map visual on one level also.
 
Kindly suggest. 
2 REPLIES 2
amitchandak
Super User
Super User

@ssubramani , Try a measure like this

 

C1 =
var _1 = countx(filter(allselected(SlicerTable),SlicerTable[SlicerValue] =1),SlicerTable[SlicerValue])
return
if(not(isblank(_1)),[Sales Category],blank())

 

or Try. I given alternate ISBLANK(SELECTEDVALUE(SlicerTable[SlicerValue]) using isfiltered


C1 =
var _1 = countx(filter(allselected(SlicerTable),SlicerTable[SlicerValue] =1),SlicerTable[SlicerValue])
return
if(not(isblank(_1)) || not(isfiltered(SlicerTable[SlicerValue])) ,[Sales Category],blank())

 

Thanks for the Inputs, Both the mesaures are working as same.  The filter is still not applied on the Mapbox visual due to the following reason.

 

I have figured out why its not working.  I have a mapbox visual with 3 levels of drill down  L1 (country) , L2(state), L3(District).  

 

L1 -  holds the Country shape file of India.

L2 - holds the State shape file of India.

L3 - holds the District shape file of India.

 

When in L1 , the sales Category for India is C2.

When in L2, the Sales category for all states in India is consolidated is C2. 

 

But I want to apply the [Sales Category] slicer for single state in L2.  

Any inputs on that ?

 

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.