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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
Super User
Super User

@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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

@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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors