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
CarlsBerg999
Helper V
Helper V

Calculate "opposite"

Hi,

 

I have a calculate function in the format of:

 

CALCULATE(SUM(COLUMN1),
FILTER(COLUMN1 = FALSE),

FILTER (COLUMN2 >= 1000),

FILTER(COLUMN3 = VALUE))

 

Can someone help me understand this more deeply:

 

1. What is the order in which the filters are applied? I understand that this is kind of like "sum" if all of the following are true. 

2. How do i do the "opposite" of this? In my data set, if i put the opposite to just the filters, the result is wrong.

 

Thanks for the help!

1 ACCEPTED SOLUTION
dobregon
Impactful Individual
Impactful Individual

@CarlsBerg999  It is not correctly created the query. 

Try to do something like this

 

query= CALCULATE(SUM(yourtable[column1]), FILTER(yourtable, yourtable[column1] = "False" && yourtable[column2] >= 1000 && yourtable[column3] = "Value"))

 

 

This will give to you the sum of column 1 when the row has the 3 condiciones (beucase i put an AND = &&)

if you want, you can put OR = || 




Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

2 REPLIES 2
dobregon
Impactful Individual
Impactful Individual

@CarlsBerg999  It is not correctly created the query. 

Try to do something like this

 

query= CALCULATE(SUM(yourtable[column1]), FILTER(yourtable, yourtable[column1] = "False" && yourtable[column2] >= 1000 && yourtable[column3] = "Value"))

 

 

This will give to you the sum of column 1 when the row has the 3 condiciones (beucase i put an AND = &&)

if you want, you can put OR = || 




Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
DataInsights
Super User
Super User

@CarlsBerg999,

 

See the link below for a detailed explanation of CALCULATE. The filter arguments are intersected (merged with the AND operator).

 

https://dax.guide/calculate/ 

 

Would you be able to provide an example of the wrong result (and underlying data) when doing the opposite calculation?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.