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