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

Measure for price per order

Hello,

 

Is there any measure that i can use to calculate the order total when it contains multiple products.

I know that i can use visuals which will do this automatically but i need also a measure to be able to filter orders based on ammounts.

 

What i need is a measure that will return the total of an order ( AAA= 30 and BBB = 200) so i can then be able to filter these orders based on a given value (more than 50, more than 100, between 10 and 100 etc for which i will use a slicer).

OrderProductPrice
AAAnnn10
AAAmmm20
BBBxxx100
BBByyy100
1 ACCEPTED SOLUTION
kitgo2
Advocate I
Advocate I

this should work:

 Measure

#Price = CALCULATE(sum(Sheet1[Price]),ALLEXCEPT(Sheet1,Sheet1[Order]))
Column - which you can use as a slicer
*Price = [#Price]

 

View solution in original post

3 REPLIES 3
Grofu
Frequent Visitor

Thank you for your help, it worked as expected for given example.

However, looking to the data, there are more scenarios that i did not forsee when using the column for slicer (which for me is much more useful).

Is there a way to have a column to return me the Expected result? I do not have other fields to differentiate. 

OrderProductPriceResultExpected result
AAAmmm104040
AAAmmm1040(blank)
AAAnnn2040(blank)
BBBxxx100200200
BBByyy100200(blank)

See if this will work for you: 

*Display = IF(Sheet1[Product] = Calculate(
minx (sheet1,[Product]),
FILTER (
ALL ( Sheet1 ),
Sheet1[Order] = EARLIER ( Sheet1[Order] )
&& Sheet1[Price] = CALCULATE(min ( Sheet1[Price] ),ALLEXCEPT(Sheet1,Sheet1[Order]))
 
)
 
 
 
), Sheet1[*Price], Blank())
kitgo2
Advocate I
Advocate I

this should work:

 Measure

#Price = CALCULATE(sum(Sheet1[Price]),ALLEXCEPT(Sheet1,Sheet1[Order]))
Column - which you can use as a slicer
*Price = [#Price]

 

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.

Top Solution Authors