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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Khalidc
Frequent Visitor

MIN filter not returning expected result

Hi

 

I would like to return the minimum value based on the selection criteria used. Using the min function does not return the expected result. Please see below examples. Maybe I am overseeing something. Great if anyone can help.

 

In below measure I calculate the minyear (minimum year selected on page filter is 2021) and use it in the filter. This does not return the desired outcome as it also returns values in 2022.

 

Khalidc_2-1669826585927.png

 

In below example I do the same, however, the filter is not based on a minimum but on a year defined, in this case 2021. This is the desired outcome as it is not showing 2022 values.

 

Khalidc_3-1669826619345.png

 

Below the filter used on the page.

 

Khalidc_0-1669826523958.png

 

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

Hi @Khalidc ,

 

According to your description you want to show the date of the minimum year, I looked at your measure and can see that when there is a problem with your minyear definition, you use the MIN function to get not the minimum date, it will be calculated in the filter context, you can try the following DAX to define your minyear:

Var minyear = MINX(ALLSELECTED('Visma_financialPeriod'),[year])

 

Best Regards,

Neeko Tang

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
v-tangjie-msft
Community Support
Community Support

Hi @Khalidc ,

 

According to your description you want to show the date of the minimum year, I looked at your measure and can see that when there is a problem with your minyear definition, you use the MIN function to get not the minimum date, it will be calculated in the filter context, you can try the following DAX to define your minyear:

Var minyear = MINX(ALLSELECTED('Visma_financialPeriod'),[year])

 

Best Regards,

Neeko Tang

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

Many thanks Neeko! It did the job.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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