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
Chandrashekar
Resolver III
Resolver III

Min & Max Selection from slicer

Hello,

 

How to select minimum and maximum date from the slicer. When I select 13-05-2024 but it is showing 20-May-2024.

am using below formula
Test_min = 
VAR min_month_calendar = CALCULATE(minx(ALLSELECTED('Calendar'),'Calendar'[Date])
RETURN format(min_month_calendar,"dd-mmm-yyyy")

 

Chandrashekar_0-1718706716163.png

Regards,

Chandrashekar B

 

5 REPLIES 5
Anonymous
Not applicable

Hi,@Chandrashekar 
Have you solved your problems?
If you have found suitable solutions, please share them as it will help more users with similar problems. Or you can mark the valid suggestions provided by other users as solutions

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

Hello,

Not sure how to solve this issue. If I go with Average below count is not big difference but count wise it has a big difference. Is there anyway I can alert that count is flucating. 

MinAvg=15.33 MaxAvg=13.00 = DiffAvg : 13.00 - 15.33 = -2.33 

WeekNumberCount
Week-2216
Week-2325
Week-245
Week-256

Regards,

Chandrashekar B

Hello,

 

As requirement is bit different still working on the solution.

 

Regards,

Chandrashekar B

Anonymous
Not applicable

Hi,@Chandrashekar 
I am glad to help you.

According to your description, you want to get the maximum and minimum date of the current selection in the slicer. But the slicer returns the wrong result
here is my test result

vjtianmsft_0-1718768611488.png

 



I used the dax code you provided and unfortunately got the correct result

vjtianmsft_1-1718768630035.png

This is very strange and I think it has something to do with the computing environment (something is wrong with the computing environment that measure is in)

I noticed that you are using the ALLSELECTED() function

You can see that when I add add a second slicer (both slicers have the same filter fields but different filter ranges)

vjtianmsft_2-1718768647915.png

At this point you can see that there is a problem with the value returned by MEASURE

In fact, when you use the ALLSELECTED function, it takes into account the values of all relevant slicers, and I think this is the reason for your problem (it works fine when there is only one filter, but has problems when there are multiple external filters, which are affected by multiple slicers at the same time, and usually give incorrect composite results).

Your code itself should be fine, but in your calculation environment there may be more than one filter on the date, which will lead to the calculation result is wrong, please check whether there are redundant filters in your settings.

Please check if there are any extra filters in your settings, and make sure that the fields in the measure are consistent with the filtered fields in the slicer.

Calculation environment is very complex but important, please check whether there are any extra filters in your calculation environment, which may affect the result of the measure.
here is my test code:

M_slicer_max = 
VAR max_ = MAX('Date'[Date_slicer])
RETURN FORMAT(max_,"dd-mmm-yyyy")
Test_max = 
VAR min_month_calendar = CALCULATE(MAXX(ALLSELECTED('Date'),'Date'[Date_slicer]))
RETURN FORMAT(min_month_calendar,"dd-mmm-yyyy")

vjtianmsft_3-1718768693636.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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



Hello,

 

Thank you for suggestion. I will try and check where is going wrong.

 

Regards,

Chandrashekar B

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.