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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jmorav291
Frequent Visitor

Override month filter slicer, when I have date range filter slicer

I have a matrix that show sales amount and anothers sales details by date. 

For the features of the report, I have 2 slicers. One with the month of the year and another with the range of dates.

I created a measure that estimate the sales amount in a selected range of dates (using the slicer of range of dates), but I have a problem when i selecting a particular month (in month of the year' slicer) the measure of sales amount ignored the range of dates selected (in the slicer of range of dates) and takes only the range between the first and last date in month selected.

How can I resolved this problem?

This is my code:

 

This is my code:

 

sales_range = 
VAR _minDate = MINX(ALLSELECTED(dates[date]), dates[date])
VAR _maxDate = MAXX(ALLSELECTED(dates[date]), dates[date])
VAR sales_range =
CALCULATE(
SUMX(sales_table,sales_table[total_sale]),
DATESBETWEEN(
dates[date],
_minDate,
_maxDate
)
)
RETURN
sales_range



2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @jmorav291 ,

 

Based on my test , you can edit the interactions between the month of the year slicer and the visual you want to show [sales_range]. In my sample, I edit the interactions between months slicer and card visual to none, the measure in card visual will only be effected date range slicer.

Capture1.PNGCapture2.PNG

 

For more details, please refer to the sample pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EW6you385DpOmhI6cd...

 

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

 

Best Regards,

Dedmon Dai

CNENFRNL
Community Champion
Community Champion

@jmorav291 , it seems your measure equally functions as this in a standard dates 1:* sales_table model.

sales_range = CALCULATE ( SUM ( sales_table[total_sale] ), dates )

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors