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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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?


@ 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!:
The Definitive Guide to Power Query (M)

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?


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors