We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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?
Solved! Go to 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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi,
Paste the formula in the body of the message. I will make the correction.
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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingIf you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 38 | |
| 34 | |
| 22 |