cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
darko861
Helper II
Helper II

Calculate and filter rows by greater than

Hi Community,

 

I have been going through a file from a Youtuber, please see the link below:

https://www.youtube.com/watch?v=uZ15A13AsHY&list=PLDz00l_jz6zym_YP8ZW11o52niGfCP8pN&index=8

 

 

Page 2 of this file has multiple measures, I have created a new measure called Cal w measure:

CAL w measure = CALCULATE(SUM(Order_Details[Tot sales]),Order_Details[Tot sales]>10000)
 
I want to display each ProductName that has values over 10 000 (e.g. the product Camembert Pierrot has the value 17 295 in column CAL Tot Sales, which I want to be displayed in the column CAL w measure too) unfortunately, it sums all the values into 41 369.50 for the Year 1998 and 10 540.00 for the Year 1997. How can I tweak the code using the Calculate function?
 
I have also tried using this measure:
CAL w measure = CALCULATE(SUM(Order_Details[Tot sales]),FILTER(Order_Details,Order_Details[Tot sales]>10000))
 
But I get the same result.
 
 darko861_0-1621601093370.png

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@darko861 Without having downloaded the file, perhaps you need an ALLEXCEPT and specify ProductName.


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@darko861 Without having downloaded the file, perhaps you need an ALLEXCEPT and specify ProductName.


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

CAL w measure = CALCULATE(SUM(Order_Details[Tot sales]),FILTER(ALLEXCEPT(FilteredProductsTable,FilteredProductsTable[ProductName]),[SUM of Total sales]>10000))
 
Yes, this seems to work!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.