cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
webportal Member
Member

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

Accepted Solutions
Vvelarde Super Contributor
Super Contributor

Re: CALCULATE first expression: must be a measure?

@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
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




4 REPLIES 4
Vvelarde Super Contributor
Super Contributor

Re: CALCULATE first expression: must be a measure?

@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
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




Sean Super Contributor
Super Contributor

Re: CALCULATE first expression: must be a measure?

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

Re: CALCULATE first expression: must be a measure?

@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 Super Contributor
Super Contributor

Re: CALCULATE first expression: must be a measure?

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/

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 199 members 2,596 guests
Please welcome our newest community members: