cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobinwDNV
Frequent Visitor

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

@RobinwDNV 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

@RobinwDNV 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors