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
sqlsasha
Employee
Employee

DAX calculating Minimum of several Summed values in a matrix

Hi team. I need some help with calculating Minimum of several Summed values.

I have a table with columns:

CategoryMonthSales Value

 

I need to have a visual (table\matrix\etc.) with

- 2 axis columns: Category, Month

- and with 2 measures: just simply Sum(Sales Value), and another measure which will show minimum by category for a list of sums per month.

 

So for example, I need to have:

 Month 1Month 1Month 2Month 2Month 3Month 3
 Sum SalesMin MeasureSum SalesMin MeasureSum SalesMin Measure
Category 1101020103010
Category 2200100100100300100
Category 3500030004000300030003000

 

10 is minimum of monthly sum(sales) per Category 1, so I need it in my Min Measure. The same for all other Categories.

Adding some saple report with data: https://www.sendspace.com/file/uhf89l 

 

Calculating an intermediate calculated table is not an option.

I really feel, that MINX might be my answer, but I can't finilize the measure by myself.

Thanks in advance

2 ACCEPTED SOLUTIONS
v-kelly-msft
Community Support
Community Support

Hi @sqlsasha

 

Create 2 measures as below:

 

_min = CALCULATE( MINX(Months,[Sales Sum]),ALL(Months))
_total = 
CALCULATE(SUM('Orders'[Sales]))

 

Finally you will see:

Annotation 2020-05-08 153811.png

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

sqlsasha
Employee
Employee

Thank you, team!

I also came (with some additional help) to the solution.

Will take some time to tottaly get into it.

dax.JPG
Thanks again for such fast help.

View solution in original post

3 REPLIES 3
sqlsasha
Employee
Employee

Thank you, team!

I also came (with some additional help) to the solution.

Will take some time to tottaly get into it.

dax.JPG
Thanks again for such fast help.
v-kelly-msft
Community Support
Community Support

Hi @sqlsasha

 

Create 2 measures as below:

 

_min = CALCULATE( MINX(Months,[Sales Sum]),ALL(Months))
_total = 
CALCULATE(SUM('Orders'[Sales]))

 

Finally you will see:

Annotation 2020-05-08 153811.png

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
amitchandak
Super User
Super User

@sqlsasha , Try one of the two

minx(summarize(Table, table[category], "_1",calculate(min(Table[Sales]),allexcept(Table,Table[category]))),[_1])

Or
minx(summarize(Table, table[category], "_1",calculate(min(Table[Sales]),all(Table[Month]))),[_1])

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.