cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

DAX Calculate function, throws error when using calculated measure as filter

Hi all, I'm floundering with a calculate function, to sum ad spend, where the ROAS is less than X.

In this case, ad spend is a static column of data for each row,
and ROAS is a calculated measure, created from revenue/spend using the following formula.
However my calculate function....
throws the below error message.
• A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Can anyone point to what I'm doing wrong.

Any help, critque or abuse for being daft, gratetfully appreciated.
1 ACCEPTED SOLUTION
Microsoft Employee

@warrencowan

As the error message said, in CALCULATE() function, the second parameter can be a True/False expression. You need to put a filted table context. So your formula should be like:

```NCS =
CALCULATE (
FILTER ( 'GA-Adwords Table', [ROAS] < 1 )
)```

Regards,

3 REPLIES 3
Regular Visitor

I have this error:

"RUBRO_C16",IF(VALOR_SALUD_COL_IND[COD RAMO CONT FINAL] IN {"045","034"},CALCULATE(SUM(VALOR_SALUD_COL_IND[VALOR_CALCULADO]),
FILTER(VALOR_SALUD_COL_IND,VALOR_SALUD_COL_IND[COD RUBRO FINAL] = "C16" )),
FILTER(VALOR_SALUD_COL_IND,VALOR_SALUD_COL_IND[COD RUBRO FINAL] = "C16" ))),

The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

Microsoft Employee

@warrencowan

As the error message said, in CALCULATE() function, the second parameter can be a True/False expression. You need to put a filted table context. So your formula should be like:

```NCS =
CALCULATE (
FILTER ( 'GA-Adwords Table', [ROAS] < 1 )
)```

Regards,

Anonymous
Not applicable

This solved my problem! thank you kindly!

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors