Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All
I am transfering a large dataset that takes ages to refresh in PowerBi desktop to a Dataflow on the PowerBi online service. I have the follwing Custom Column in my current desktop quiery.
Duration* = var _newavg =AVERAGEX(filter('Data','Data'[Last Operator]=EARLIER('Data'[Last Operator]) && 'Data'[Customer Name]=EARLIER('Data'[Customer Name]) && 'Data'[Production Task Name]=EARLIER('Data'[Production Task Name]) && 'Data'[Duration]<15),'Data'[Duration]) return if('Data'[Duration]<15,'Data'[Duration],_newavg)
This works fine in the desktop but when I add the same column in the Dataflow UI I get the a warning of 'Token Eof expected'.
(Please note, some of the column names are different below but are correct to the columns in the Dataflow table).
The error seems to be with the var '_newavg'. I've tried chaging the var name but get the same error.
Any ideas what's causing this?
Thanks
Thom
Solved! Go to Solution.
Hi. I think you are confused. That code is DAX. DAX is a query language that runs over a data model already built. The edit queries or transform data in power bi desktop works with power query. In power query, the queries will run over the data source in order to build the data model. They are a previous step. Dataflows works with power query too.
You can't copy a DAX code there because it uses a completely different language.
If you want to move to dataflows you have to move your power query code. Then connect your power bi desktop to the dataflow and use the same dax code in both of them.
I hope I have explained myself. It's a lot to talk about.
Regards,
Happy to help!
Hi @topcat777 ,
Show some sample data we might be able to help you convert this formula to M query.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi. I think you are confused. That code is DAX. DAX is a query language that runs over a data model already built. The edit queries or transform data in power bi desktop works with power query. In power query, the queries will run over the data source in order to build the data model. They are a previous step. Dataflows works with power query too.
You can't copy a DAX code there because it uses a completely different language.
If you want to move to dataflows you have to move your power query code. Then connect your power bi desktop to the dataflow and use the same dax code in both of them.
I hope I have explained myself. It's a lot to talk about.
Regards,
Happy to help!
Hi @ibarrau
Thanks for your reply and sorry for my late one. Yes, I'm a doofus. It was a DAX command. I'll add this in the correct place in my build. Thanks again for your help.
Thom.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.