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
vazperen
Frequent Visitor

Making the MIN value a constant or passing it to another measure

I am trying to use the MIN result in other measures.  I have a list of products that were sold over several week.  In order to find the MIN it was suggested to use:

 

BM = MINX(SUMMARIZE(Table1,[Products],"MIN",[Sales]),[MIN])

 

That worked perfectly fine to find the MIN for the average sales in products in a sumarized filtered table by date range.  The result is 52.33.

 

Capture.PNGThe question is how do I pass the value in another measure?  What I want to do is to take the average sales for each product minus the MIN value.

An example would be:

 

Product A minus MIN: 73.50 - 52.33 = 21.17

Product B minus MIN: 52.33 - 52.33 = 0

 

The MIN is dynamic as it changes based on filters applied to the table. Thanks!

1 ACCEPTED SOLUTION
Melvlee
Helper I
Helper I

Hi Vazperen,

 

A quick win is to create a duplicate Sales table. It's meant for calculating BM so it can just have the necessary columns.

Then in your main Sales table, you can create a measure to work out (Avg Sales - BM). 

In this way, BM is always the same value as the duplicate table has no relationship with the main Sales table.

Hope this helps.

 

View solution in original post

6 REPLIES 6
Melvlee
Helper I
Helper I

Hi Vazperen,

 

A quick win is to create a duplicate Sales table. It's meant for calculating BM so it can just have the necessary columns.

Then in your main Sales table, you can create a measure to work out (Avg Sales - BM). 

In this way, BM is always the same value as the duplicate table has no relationship with the main Sales table.

Hope this helps.

 

Ashish_Mathur
Super User
Super User

Hi,

 

=[Sales]-[BM]

 

Does this work?


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

No, because the BM column that you see is the average sales for each product; therefore, =[AvgSales]-[BM] gives me zero for all products. 

So then it should be

 

=[Your sales measure]-[BM]


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

The problem is BM.  BM is holding the values of each product.  If you see the formula fro BM it is sumarrizing the sales by product, then looking up the MIn out of that virtual column; therefore, it is not holding 52.33, but the average sales by product.  Maybe I need to change how to figure out the MIN in a different way.

The only way i can help you is if you share a link of your file.  Also, show the expected result there.


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

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.