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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tevon713
Helper IV
Helper IV

Lookup slicer filter selection and count number of row

Hi.

 

Simple question, I want to return a count number of row or a hard coded value based on slicer selection.

See example table below.

 

If user select Region = Central, expected return value = 3... more like nested if/else or switch. This return value will then be use in a calculation for a average, hope this I'm making sense.

 

How would I able to achieve this? Thanks you all for your help.

 

I'm imagining a measure of the following...

 

Measure = 
If Region Slicer = Central return count sites value = 3
else if
Region Slicer = North return count sites value = 3
else if Region Slicer = North East return count sites value = 4
else if Region Slicer = North West return count sites value = 3
else if Region Slicer = South return count sites value 4
else return count sites value 17

 

Data table:

SiteRegion
Site 1Central
Site 2Central
Site 3Central
Site 1North
Site 2North
Site 3North
Site 1North West
Site 2North West
Site 3North West
Site 1South
Site 2South
Site 3South
Site 4South
Site 1North East
Site 2North East
Site 3North East
Site 4North East

 

Expected Solution:

Selected Region# of Site/Row
Central 3
North3
North West3
South4
North East4

 

 

2 REPLIES 2
Syk
Super User
Super User

You can add both columns to your table then set the sites to "Count". See screenshot for reference:

Syk_0-1654779714184.png

 

Thanks @Syk, understood. But what I'm seeking is returning that value to be use in a calculation.

Something along the line of this....

 

If Region Slicer = Central return count sites value = 3
else if
Region Slicer = North return count sites value = 3
else if Region Slicer = North East return count sites value = 4
else if Region Slicer = North West return count sites value = 3
else if Region Slicer = South return count sites value 4
else return count sites value 17

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.