Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Hsilva
Helper I
Helper I

Calculate error

Hi all,

I am trying to use Calculate with a measure as a filter and got the below error:

"A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

my formula is : Total Rev New Referrer = CALCULATE([Total Revenue],[Lost Referrers]=1)

where Total Revenue is a measure = Sum (sales[revene]) and Lost Referrer is another measure 

Lost Referrers = IF([Total Revenue]<>0 && [Total Rev L3M]=0,1,0)

 

How can I sum the revenues filtering the lost referrer measure = to 1?

thanks in advance for your help.

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Hsilva 

 

The filter expression i.e [Lost Referrers] = 1 must be used to filter an appropriate table first.

 

Total Rev New Referrer =
CALCULATE ( [Total Revenue], FILTER ( TableName, [Lost Referrers] = 1 ) )

Depending on your case, you can use

1) TableName

2)ALL(TableName)
3)ALL(TableName[ColumnName])

etc


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Hsilva 

 

The filter expression i.e [Lost Referrers] = 1 must be used to filter an appropriate table first.

 

Total Rev New Referrer =
CALCULATE ( [Total Revenue], FILTER ( TableName, [Lost Referrers] = 1 ) )

Depending on your case, you can use

1) TableName

2)ALL(TableName)
3)ALL(TableName[ColumnName])

etc


Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad 

Thank you very much for your help, that was very helpful.

 

 

Helpful resources

Announcements
Europe Fabric Conference

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 Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors