Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Copied DAX expression does not work

Dear community, hopefully one of you can help me out with the issue I am currently dealing with.

 

first a bit of context;

 

I am recreating a power BI report from an example, that contains a data table, a date table, and a measures table.

the data table contains personnel information, and consists of "closing" count of employees and "opening" count of employees. It shows at a given month what the amount of personnel was at the start of the month (opening), versus at the end of the month (closing).

 

the measures table will consist of 2 measures; how many "opening" workers vs. how many "closing" workers. In the example the formulas are;

 

ClosingWorkers = CALCULATE(count('Headcount development and turnover (2)'[Person Number]), 'Headcount development and turnover (2)'[Status] = "Closing")
 and 
OpeningWorkers = CALCULATE(count('Headcount development and turnover (2)'[Person Number]), 'Headcount development and turnover (2)'[Status] = "Opening")
 

All went well untill I tried to copy the DAX formula from the measures table. I receive the error:

 

"The expression specified in the query is not a valid table expression."

 

Which is strange, because everything is correct according to the example file. and CALCULATE and COUNT are both expressions accepted by Power BI. Does anyone know why this error might occur? My suspision is that it has something to do with the difference in settings or installations, but I am far from an expert. 

 

I am looking forward to your replies, many thanks in advance!

 

Kind regards,

 

Robin

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Did you paste this into a calculated Table expression instead of a measure expression?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Anonymous Did you paste this into a calculated Table expression instead of a measure expression?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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