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
Gekko1
Helper I
Helper I

Get all values from date prior to selected on slicer

So, I have this table where I got the value of the transaction made on a credit card, the date of the actual sale and the date when the money was liberated to the seller. I want a filter that work like this: when I select a month and a year on slicers, a table gets all the values prior to the last day of that month which are not yet paid i.e. not liberated, which have the pay dates after the selected date.

ValueSaleDateLiberationDate
5001/01/202201/02/2022
10001/31/202203/01/2022
15002/25/202203/01/2022
20002/28/202203/01/2022
25003/01/202203/02/2022


Accordingly to the table above, if I select the month February it will return the sum of 100, 150 and 200 because, the actual pay date of these sales are made after the last day of the selected month but will not return 250 because the sale wasn't made until the last date of february 2022.

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @Gekko1 ,

 

First, please try following DAX to create a date table:

Table = ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2022,3,31)),"Month",MONTH([Date]))

vyadongfmsft_0-1663225865208.png

 

Then try following measure:

Measure = 
VAR cur_month  = SELECTEDVALUE('Table'[Month])
VAR cur_value =  CALCULATE(SUM('Sale'[Value]),FILTER(ALL('Sale'), MONTH('Sale'[SaleDate]) <= cur_month && MONTH('Sale'[LiberationDate] ) > cur_month))
return cur_value

 

The result you want:

vyadongfmsft_1-1663225968590.png

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Gekko1
Helper I
Helper I

Thank you very much, it worked.

v-yadongf-msft
Community Support
Community Support

Hi @Gekko1 ,

 

First, please try following DAX to create a date table:

Table = ADDCOLUMNS(CALENDAR(DATE(2022,1,1),DATE(2022,3,31)),"Month",MONTH([Date]))

vyadongfmsft_0-1663225865208.png

 

Then try following measure:

Measure = 
VAR cur_month  = SELECTEDVALUE('Table'[Month])
VAR cur_value =  CALCULATE(SUM('Sale'[Value]),FILTER(ALL('Sale'), MONTH('Sale'[SaleDate]) <= cur_month && MONTH('Sale'[LiberationDate] ) > cur_month))
return cur_value

 

The result you want:

vyadongfmsft_1-1663225968590.png

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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