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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
topcat777
Frequent Visitor

Transferring Power BI dataset to dataflow, getting Token Eof expected error on custom column

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

Capture.JPG

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

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,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

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.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
ibarrau
Super User
Super User

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,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors