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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
xl0911
Helper III
Helper III

Unfilter measure with slicer date only the less side

Hello,

 

I have a Year slicer (2017, 2018, ....) and a Month slicer (Jan, Feb,....) and in this dashboard all the charts that connect to those slicers are working very good.

 

My issue is that I want to add a measure (and a chart) that will connect to those slicers but on the "less" side and not on the "Greater" side, and what I mean by that, for example if I select 2020 in the Year slicer and Apr in the Month slicer this measure needs to filter by:  <= April 2020     and not  <= April 2020 <=   (as it by defaulte).

The ather measures needs to stay the same.

 

The measure is this formula:

MyMeasyre = CALCULATE( SUM(Sales[Price]) , USERELATIONSHIP(Tbl_Dates[Date], Sales[SaleDate])

 

1 ACCEPTED SOLUTION
rbriga
Impactful Individual
Impactful Individual

Try changing the first two vars:

VAR _Year = MAX('Tbl_Dates'[Year])   

VAR _Year = MAX('Tbl_Dates'[Month NUMBER])

 

Do you get the desired outcome now?

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

5 REPLIES 5
xl0911
Helper III
Helper III

Thank you, very nice solution, but if all slicer is open (nothing is selected) the it gets the MIN value which it makes more sense if nothing selected I rather gets the MAX... is it possible ?

rbriga
Impactful Individual
Impactful Individual

Try changing the first two vars:

VAR _Year = MAX('Tbl_Dates'[Year])   

VAR _Year = MAX('Tbl_Dates'[Month NUMBER])

 

Do you get the desired outcome now?

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Perfect ! thank you very mutch !

rbriga
Impactful Individual
Impactful Individual

Happy to help

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!
rbriga
Impactful Individual
Impactful Individual

First, it seems you have a dates table. I'm not sure why you need to use USERELATIONSHIP(Tbl_Dates[Date], Sales[SaleDate]) if the relationship is already established, though.

 

Now, You'll need a measure to calculate the sum until the selected date.

I assume that the year and month filters relate to the Tbl_Dates table.

I'll suggest:

Sales Up to Date=

VAR _Year = MIN('Tbl_Dates'[Year])   

VAR _Year = MIN('Tbl_Dates'[Month NUMBER])  --MIN would cause this VAR to be 1 (January) if no moth is selected

VAR _LimitDate = DATE(_Year,_Month,1)

RETURN

CALCULATE(

SUM(SUM(Sales[Price]),

REMOVEFILTERS('Tbl_Dates'),    --Since we don't really want to filter to these dates

KEEPFILTERS(Sales[SaleDate]<_LimitDate)

)

Give it a try.

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors