Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
All,
I previously had a running sum query that worked perfectly. However, I migrated my data to a DirectQuery and it's not longer working due to the limited DAX functionality.
Initial Query before migrating to direct query.
Running Total =
IF (
Report_Monthly[Date] <= TODAY (),
CALCULATE (
SUM ( Report_Monthly[Produced_Qty] ),
ALLEXCEPT ( Report_Monthly, Report_Monthly[Work_Center] ),
Report_Monthly[Date] <= EARLIER ( Report_Monthly[Date] )
)
)
When I tired to use this same DAX function when switching over to a DirectQuery the following error displays.
Based on other posts I assumed the following would have worked.
Running Total =
IF (
Report_Monthly[Date] <= TODAY (),
CALCULATE (
SUM ( Report_Monthly[Produced_Qty] ),
FILTER (
ALLEXCEPT ( Report_Monthly, Report_Monthly[Work_Center]),
Report_Monthly[Date] <= MAX ( Report_Monthly[Date] ))
)
)
However, I'm getting the following error "Function 'Calculate' is not allowed as part of calculated column DAX expression in DirectQuery models." I've gone into options and selected "Allow unrestricted measures in DriectQuery mode."
Solved! Go to Solution.
Hi @jersey417,
From your formula, you created a calculated column rather than a measure. In the case you posted, they create a measure rather than a calculated column. You get the error caused by DAX Formula Compatibility limitation, please review more details in the blog: DAX Formula Compatibility in DirectQuery Mode.
Please create a measure using the formula below and check if it works fine.
Running Total = IF ( FIRSTNONBLANK ( Report_Monthly[Date], Report_Monthly[Date] ) <= TODAY (), CALCULATE ( SUM ( Report_Monthly[Produced_Qty] ), FILTER ( ALLEXCEPT ( Report_Monthly, Report_Monthly[Work_Center] ), Report_Monthly[Date] <= MAX ( Report_Monthly[Date] ) ) ) )
Best Regards,
Angelia
Hi @jersey417,
From your formula, you created a calculated column rather than a measure. In the case you posted, they create a measure rather than a calculated column. You get the error caused by DAX Formula Compatibility limitation, please review more details in the blog: DAX Formula Compatibility in DirectQuery Mode.
Please create a measure using the formula below and check if it works fine.
Running Total = IF ( FIRSTNONBLANK ( Report_Monthly[Date], Report_Monthly[Date] ) <= TODAY (), CALCULATE ( SUM ( Report_Monthly[Produced_Qty] ), FILTER ( ALLEXCEPT ( Report_Monthly, Report_Monthly[Work_Center] ), Report_Monthly[Date] <= MAX ( Report_Monthly[Date] ) ) ) )
Best Regards,
Angelia
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |