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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mikhailry
Frequent Visitor

Measure slicer

Hi everyone,

 

I was wondering if you guys can help with tips and tricks on how to slice the data based on an aggregated column. 

 

I have raw data stored in the Sessions table like this: 

Sessions tableSessions table

Table: Sessions

 

Different articles are viewed on several websites. I need to aggregate the data to see the number of views for each article with the ability to filter by website and date. Everything looks good in the table, where Views = sum( 'Sessions'[views]).

What I want to do is to make the 'Views' slicer dynamic based on other filters selection. 

 

When no filters are selected: Views slicer should show a range between 111 and 220:

no filters selected.jpg

View: no filters selected

When the 'Website1' filter is selected, the Views slicer should show a range between 100 and 200, and if I change the range on the slicer to be between 100 and 150, the table should show only article 1. 

website1.jpg

View: website1 filter selected

 

I was thinking of creating a measure to calculate the total amount of views, but I can't use measure in the slicer. Any word of advice will be helpful on how to approach it in the most efficient way.

 

Thank you

2 REPLIES 2
amitchandak
Super User
Super User

@mikhailry , assuming view is  measure and you want to control it by slicer viewslicer

 

Measure  =

var _min = minx(allselected(Viewsslicer), Viewsslicer[values])

var _max = maxx(allselected(Viewsslicer), Viewsslicer[values])

return 

Sumx(values(Table[Article]), if([Views] >=_min && [Views] <=Max , [View], blank()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey @amitchandak ,
Thanks for your response. 


I'm not sure that I'm following your solution. Let me try to elaborate on the problem. 
Per my understanding, I need to create the following:
1. Measure to calculate Total Views in the table. I guess it should be something like that:

views_m = CALCULATE(sum(sessions[Views]), ALLSELECTED(sessions[Website]))
 
2. Column or table to feed the slicer (can't assign a measure to the slicer). The max and min values in the slicer should be dynamic, based on selection in other filters, for example, if 'website 1' filter is checked, the slicer's min value should be 100 and a max value = 200.  
website1.jpg
And if I change the min value in the slicer to be 150, I shoud see only one row in the table - article 2 | 200.
 
Is that a right logic?
Thanks

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.