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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Enigma
Helper III
Helper III

Power Query Editor or Data View?

I was adding a custom column for doing some text manipulations based on values in an existing date column. I realised that DAX functions aren't recognised in Power Query Editor, so I had to write it in the Data View.

 

Apart from the language restrictions, what are the best practices on when to use PQE vs DV?

My report contains multiple queries and large data, so I want to use all tips to make the data refreshes as quick as possible.

In my requirement, what is a more efficient way - writing in DAX language in DV; or, writing in M language in PQE?

1 ACCEPTED SOLUTION

Yeah, honestly this might be one of those exceptions where it is better/faster/easier to just use DAX. Switch statements in PQ are a pain but can be done: https://www.thebiccountant.com/2018/02/15/generic-switch-function-query-editor-in-power-bi-and-power...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Greg_Deckler
Community Champion
Community Champion

Well, like most things, it depends. But the general rule is that the further "upstream" that you can push the creation of custom columns the better. So that is M and PQ. But, there are lots of caveats and exceptions to that rule, would need to better understand your requirements.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler 

The requirement: Extract the month number from a date column. Then, assign a text based on the month number.


I used this in PQE

SWITCH(Date.Month([Download Date]),1,"Q2",2,"Q2",3,"Q3",4,"Q3",5,"Q3",6,"Q4",7,"Q4",8,"Q4",9,"Q1",10,"Q1",11,"Q1",12,"Q2","Unknown Month")

 

While the 'Date.Month([Download Date])' worked, the 'SWITCH' gave an error. 

Yeah, honestly this might be one of those exceptions where it is better/faster/easier to just use DAX. Switch statements in PQ are a pain but can be done: https://www.thebiccountant.com/2018/02/15/generic-switch-function-query-editor-in-power-bi-and-power...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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