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
webportal
Impactful Individual
Impactful Individual

CALCULATE first expression: must be a measure?

Why does this measure works:

 

Medida = CALCULATE('Factos'[Faturação *];FILTER('Factos';'Factos'[PreçoUnitário]>=50))

Whereas this one doesn't:

 

Medida = CALCULATE('Factos'[Faturação];FILTER('Factos';'Factos'[PreçoUnitário]>=50))

The difference is that "Faturação *" is a measure while "Faturação" is a column.

 

By reading the DAX reference here, I can see the following remark:

The expression used as the first parameter is essentially the same as a measure.

 

So, what's the conclusion? That I must use a calculation as the 1st argument of the function?

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@webportal

 

The second fail because you need to say what calculation or function need to do.

 

Like Sum, Count, Average, Values or another

 

 




Lima - Peru

View solution in original post

4 REPLIES 4
Sean
Community Champion
Community Champion

When you are referencing a COLUMN you need some kind of aggregation like SUM, etc..

What is the formula in your Measure?

 

Also when you reference a Column use the TableName[Column Name]

when you reference a Measure just the [Measure Name]

https://www.powerpivotpro.com/2014/10/5-common-mistakes-made-by-self-taught-dax-students/

 

 

webportal
Impactful Individual
Impactful Individual

@Sean, the expression is:

Faturação * = SUMX('Factos';'Factos'[PreçoUnitário]*'Factos'[Unidades])

 

I think I got the idea: since Faturação * is already agregating it works, whereas Faturação is just a column.

Sean
Community Champion
Community Champion

Yes and you can add the FILTER in your Measure like this...

 

Faturação * =
SUMX (
    FILTER ( 'Factos'; 'Factos'[PreçoUnitário] >= 50 );
    'Factos'[PreçoUnitário] * 'Factos'[Unidades]
)

 

https://www.powerpivotpro.com/2014/10/sum-sumx-or-calculatechoices-choices/

Vvelarde
Community Champion
Community Champion

@webportal

 

The second fail because you need to say what calculation or function need to do.

 

Like Sum, Count, Average, Values or another

 

 




Lima - Peru

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.