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
darko861
Resolver II
Resolver 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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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
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.