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
Hernán
Frequent Visitor

Min value in a column by month without duplicates values (DAX or Power Query)

Hello team,

 

I've tried to create a calculate column or a measure but I couldn't achieve my goal. I read in the forum similar situation but It didn't work for me.

 

 

I need to build a calculate column or a measure where: Every month selects the minimum value by store and by service. Thus:

 

Image1. Current matrix

current matrix.PNG

 

Image2. I expected a column or measure with the min value in the store as the right table in the below image.

I expected.PNG

I expected:

I expected2.PNG

In that case I filtered the year 2022 and month September. It is the reason it shows only info in sep2022. But, It applies for every month. The data is showed only by month and year (sep-2022, nov-2022...)

Note: The overall has three values: 1, 2, 3. Thus, the minimum values will be 1 and the maximum 3. If the Store has as overall zero, (null). The value zero, it won't count in the overall because it is a empty value. It musn't be taken in the "Min overall".

 

Attached .pbix, data.xlsx and I expected e.g. sep2022

 

Thank you so much for your help!

 

Regards,

Hernán Montoya

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

OA = SUM(Sheet1[Overall])
Measure = if(HASONEFILTER(Sheet1[City]),[OA],MIN(Sheet1[Overall]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

OA = SUM(Sheet1[Overall])
Measure = if(HASONEFILTER(Sheet1[City]),[OA],MIN(Sheet1[Overall]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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