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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CraigSchulz
Helper II
Helper II

Error Message When Creating New Measure

While creating a new measure, the following code worked just fine until I added the last filter within 'Calculate', then I got the error message shown below. I'm not sure how to correct this, or where to find the table filter the message indicates. Can someone help me understand what is happening here?
PBI formula.png

 

 

 

1 ACCEPTED SOLUTION

CALCULATE filters cannot use measures by themselves. You'd need to use a FILTER() function there.

 

AvgParkedByNoon = CALCULATE(
SUM(SMSYTD[ParkedByNoon])/DISTINCTCOUNT('Calendar'[Date]),
'Calendar'[IsHoliday]=FALSE(),
FILTER('Calendar','Calendar'[Day of Week]=[DoWtoday])
)

So without loading this in and testing it, the above should work. See this article for more info on why FILTER is sometimes necssary within CALCULATE.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Paste the formula in the body of the message.  I will make the correction.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Okay, Thanks.

 

AvgParkedByNoon = CALCULATE(
SUM(SMSYTD[ParkedByNoon])/DISTINCTCOUNT('Calendar'[Date]),
'Calendar'[IsHoliday]=FALSE(),
'Calendar'[Day of Week]=[DoWtoday]
)

CALCULATE filters cannot use measures by themselves. You'd need to use a FILTER() function there.

 

AvgParkedByNoon = CALCULATE(
SUM(SMSYTD[ParkedByNoon])/DISTINCTCOUNT('Calendar'[Date]),
'Calendar'[IsHoliday]=FALSE(),
FILTER('Calendar','Calendar'[Day of Week]=[DoWtoday])
)

So without loading this in and testing it, the above should work. See this article for more info on why FILTER is sometimes necssary within CALCULATE.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.