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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Adity
Regular Visitor

MIN Function giving wrong total

Screenshot_2.pngI have 2 measures say
Total_Sales & Sales_LastYear.
I needs to find the MIN of these two column and sum the MIN value. When I do so, It shows the sum of Sales_LastYear.
Dax used:
Minimum (Incorrect Total) = MIN( [Total Sales], [Sales LY] )
Where am I going wrong?
1 ACCEPTED SOLUTION

Hi, @Adity 

Maybe it need a little modified ,try to add another formula as below:

Measure = SUMX('Table',[Minimum (Incorrect Total)])

or

Measure = SUMX('Date'[Month Year],[Minimum (Incorrect Total)])

46.png

 

If it doesn't work , please share your sample file for further research.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

8 REPLIES 8
PhilipTreacy
Super User
Super User

Hi @Adity 

You need to show us your data and what you are doing otherwise we're working in the dark and guessing.

You said that you've got 2 measures and that you need to find the MIN of these 2 columns.  Measures and Columns are different things.  You can't get the MIN of a measure because a measure only produces a single value.

Again, without seeing you data and your calculations, it's not clear what you are trying to do.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Screenshot_2.pngIf you can see the total.. It shows 1,68,075.. But it should have been close to 6000.. 😞

Hi, @Adity 

Maybe it need a little modified ,try to add another formula as below:

Measure = SUMX('Table',[Minimum (Incorrect Total)])

or

Measure = SUMX('Date'[Month Year],[Minimum (Incorrect Total)])

46.png

 

If it doesn't work , please share your sample file for further research.

 

Best Regards,
Community Support Team _ Eason

@PhilipTreacy .. Can you please check the tread below.. I added the picture of What i am expecting excatly. 

jaideepnema
Solution Sage
Solution Sage

Hi @Adity ,
can you please share some sample data for the same and also the expected output ?

This i what I am expecting.. It has the total sales thi year and total sales last year. It finds the MIN .. BUt while summing up .. It creates an issue. Need help to fix thisThis i what I am expecting.. It has the total sales thi year and total sales last year. It finds the MIN .. BUt while summing up .. It creates an issue. Need help to fix thisThis is the sample.. Have the Total sales and comparing with sales last year. Finding the Minimum of it too! but somewhere I miss the total of it.. Can u suggest something on why this happens?

amitchandak
Super User
Super User

@Adity , For total you need force a row context

 

example

 

Sumx(Values('Date'[Month Year]), calculate( MIN( [Total Sales], [Sales LY] )))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak  For some reason I dont find any change in the solution. By giving your query i wasnt able to see the MIN values in my column.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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