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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sunah132
Helper I
Helper I

Minimum value subtotal based on specific dates

Hi,

 

I'm trying to add subtotal with the minimum value and the subtotal is also taking a minimum of the total price.

If I want to apply value as a minimum and sum up them into the subtotal, what would be a good way?

Thank you in advance.

 

item5/1/20215/2/20215/3/2021TotalExpected
1100100100100300
2150150150150450
3200200200200600

 

sunah132_0-1622102443172.png

In this one, the total should be 912.8 as expected.

Thank you.

1 ACCEPTED SOLUTION

Hi, @sunah132 

Thank you for sharing.

Please try the below.

 

Picture1.png

 

Min Value measure =
SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[item] ), SUMX ( VALUES ( 'Table'[Date] ), MIN ( 'Table'[Value] ) ),
SUM ( 'Table'[Value] )
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

10 REPLIES 10
Jihwan_Kim
Super User
Super User

Hi, @sunah132 

Please try something like below.

 

Min Value measure =
SUMX ( VALUES ( 'Table'[Date] ), MIN ( 'Table'[Value] ) )

 

Picture3.png

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you so much!

That measure applied on my report successfully.

If I would like to calculate row subtotal, would it be using same as this Min Value measure =
SUMX ( VALUES ( 'Table'[Date] ), MIN ( 'Table'[Value] of drill up value ) ) ?

Hi, @sunah132 

Thank you for your feedback.

Sorry that I quite do not understand your last question.

Please describe how you like to see the row subtotal.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Sorry, I meant to explain this below. I applied your suggestion that had total value on the column but rows still appear to have a minimum value. 

sunah132_0-1622131751747.png

 

Hi, @sunah132 

Thank you for sharing.

Please try the below.

 

Picture1.png

 

Min Value measure =
SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[item] ), SUMX ( VALUES ( 'Table'[Date] ), MIN ( 'Table'[Value] ) ),
SUM ( 'Table'[Value] )
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hello, Thank you for your suggestion and It worked very well.

I faced the problem that there was no pricing made on a certain date. It resulted in a total of 0 while they bring summing up the minimum values. Could you please see how it should be?

I appreciate your help!

sunah132_1-1623049314692.png

 

Hi, @sunah132 

Please try the below.

 

Min Value measure =
SWITCH (
TRUE (),
ISINSCOPE ( 'Table'[item] ), SUMX ( VALUES ( 'Table'[Date] ), CALCULATE( MIN ( 'Table'[Value] )) ),
SUM ( 'Table'[Value] )
)
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you! I have one last question regarding the Matrix calculation. When there's drill down like this, adding Calculate at SUMX would sum up the entire Hub but not in route level. I have tried adding SUM('Table'[Value]) as route but the visual failed to do so. 

sunah132_0-1623218842697.png

 

Hi, @sunah132 

Thank you for your feedback.

Please try to replace "isinscope" with "isfiltered".

And try to include the proper column inside the isfiltered DAX function.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you so much! It was very helpful.👍

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.