How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (2024)

Chris A.

IT Specialist @ U.S. VA OIG | Power Platform Development, Workflow Optimization

  • Report this post

Last week some time Owen Price mentioned how he wished #powerquery M was treated more like a first-class language. Today I provide some supporting evidence.In VBA you can definitely make POST requests. It's actually not too bad at all. I wrote code to loop through all queries in Excel, send the code to PowerQuery formatter, and then replace the code with the response.In order to make that happen efficiently, I had to import a module to help with processing the JSON and I think I wrote about 3-4 subs and functions to make it all work.Below is the same result, with M code, using Power Query in Excel.There's so much you can do with it, often with just a few steps. Looking forward to enhancements to the coding experience, because this is one of the features of #Excel and #PowerBI that I really love.#lihm

  • How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (2)

31

19 Comments

Like Comment

Rick de Groot

I make Power Query easy for everyone ๐Ÿฆ | Microsoftยฎ MVP | Power BI Consultant | Master Data Transformation ๐Ÿ‘‰ powerquery.how

8mo

  • Report this comment

Owen, Chris - I'm still looking for some use-cases for https://powerquery.how on how to use the numerations: WebMethod.PostWebMethod.DeleteWebMethod.GetWebMethod.HeadWebMethod.PatchWebMethod.PutI'm not even sure which functions support the enumerations to begin with. Is something that could work with the example above? And if not, any idea where they're being used?

Like Reply

2Reactions 3Reactions

Henrik Vestergaard

BI developer at Aarhus Universitet | Owner of henrikBLUEvestergaard

8mo

  • Report this comment

Looks sharp. How do invoke the M function on all queries.

Like Reply

1Reaction 2Reactions

Hasnain Sabir

Data Analyst | Power BI & ERP Implementation | IFRS | Advanced Excel, Power BI Trainer | Accounts Finalisation As Per IFRS | System Designing and Development | VAT Consultant | Internal Control Sys

8mo

  • Report this comment

Lets make one group where these value added post will be shared.

Like Reply

2Reactions 3Reactions

Hasnain Sabir

Data Analyst | Power BI & ERP Implementation | IFRS | Advanced Excel, Power BI Trainer | Accounts Finalisation As Per IFRS | System Designing and Development | VAT Consultant | Internal Control Sys

8mo

Its really very amazing. Its also motivate me to upskill myself in this area at advanced level

Like Reply

1Reaction 2Reactions

Owen Price

Data Analytics Professional | Microsoft MVP

8mo

  • Report this comment

Beautiful!Are the line feeds required by the API?

Like Reply

1Reaction 2Reactions

See more comments

To view or add a comment, sign in

More Relevant Posts

  • Alastair Harris

    Finance & Systems & Excel GEEK

    • Report this post

    #PowerQuery is an excellent tool for getting and manipulating data. Excellent set of connectors and a powerful programming language with a useful menu driven front end to get you started. So you have captured data - where to next? Thing is, I get that #Excel has PowerPivot and a data model tool, but actually I want to use a database with SQL, and I want it to be an end user tool rather than a corporate data centre. And I want to use the data I have manipulated. Which to my mind means Access. Actually I could use VBA and the Jet database engine that lives within Excel, but I like the Access UI. Of course Access doesn't have PowerQuery, although I could use SQL. But in fact data ETL is often better done in a tool like PowerQuery, with its M language. And Acess does offer me good connectivity.So come on #Microsoft. Stop hobbling me. Make these things work better together. #Access remains a wonderful end user desktop database. Embrace it, and bundle it within #Excel!

    20

    11 Comments

    Like Comment

    To view or add a comment, sign in

  • Rick de Groot

    I make Power Query easy for everyone ๐Ÿฆ | Microsoftยฎ MVP | Power BI Consultant | Master Data Transformation ๐Ÿ‘‰ powerquery.how

    • Report this post

    I researched the DateTime.ToText function in #powerquery , here's what I learned. ๐—•๐—ฎ๐˜€๐—ถ๐—ฐ๐˜€By default, the DateTime.ToText function uses the culture of your system to transform a datetime value to text. That means the output can differ depending on where your query refreshes. ๐—™๐—ผ๐—ฟ๐—บ๐—ฎ๐˜You can output a specific format by providing a formatting string. These can be rather cryptic. The updated article on powerquery[dot]how now contains an overview with all relevant combinations. Some fun examples: Turning "12/31/2023 1:30:25 AM" into text can result in: t - "1:30 AM"T - "1:30:25 AM"r - "Sun, 31 Dec 2023 01:30:25 GMT"F - "Sunday, December 31, 2023 1:30:25 AM"You can find all other variations in the attached picture. ๐—–๐˜‚๐—น๐˜๐˜‚๐—ฟ๐—ฒThe output formats can change depending on the specific local cultures. nl-NL: uses dd-mm-yyyyen-US: uses mm/dd/yyyynl-NL: no AM/PM notationen-US: uses AM/PMFor all other differences, find the article at #powerqueryhow .Happy tuesday!PS. If this was useful, consider reposting so others can follow along! โ™ป๏ธ

    • How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (15)

    213

    23 Comments

    Like Comment

    To view or add a comment, sign in

  • Michael Berry

    Data Platform Manager | Analytics Engineer | Microsoft Fabric | Azure | Databricks

    • Report this post

    Interesting investigation into the PowerQuery DateTime.ToText function

    28

    1 Comment

    Like Comment

    To view or add a comment, sign in

  • Chandeep Chhabra

    Power BI Trainer and Consultant

    • Report this post

    Here are 9 little things (hacks) in #PowerBI. ๐Ÿš€ Tell me which one is your favorite. ๐Ÿ˜Video link in the comments. Enjoy!#DAX #PowerQuery #visualization

    • How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (24)

    121

    5 Comments

    Like Comment

    To view or add a comment, sign in

  • Chris A.

    IT Specialist @ U.S. VA OIG | Power Platform Development, Workflow Optimization

    • Report this post

    Learn how to reformat all of your #PowerPivot #DAX formulas by calling the SQLBI DAX Formatter with a little VBA.This is a follow up to a previous post where I called an API to reformat all of my #powerquery code in Excel.I know a lot of people are probably trying to figure out #Fabric and are asking, "Why?".Personally, for quick/ad hoc analysis that does not need a refresh, I am going to try and use Excel if I can. Also, I often have to provide code and documentation so that someone could reproduce it later on. I can code in #Python and have been learning a little #R, but often for these kinds of analysis I am working with someone that has neither installed and does not have experience coding in either one.At the very least, if I can stay in Excel, I know they have it installed, and I can more easily walk them through it. REMINDER:#VizForVets has our monthly meeting with Albert Bellamy set to present this Wednesday (June 21st) at 6pm ET. RVSP link in the comments. You don't want to miss it, he always speaks very candidly and boils things down for people so that you have the right x, y, z to make things happen. If you want to build your brand and reach, join us.

    Reformatting DAX Queries in Power Pivot with VBA https://www.vizforvets.com

    16

    2 Comments

    Like Comment

    To view or add a comment, sign in

  • Rick de Groot

    I make Power Query easy for everyone ๐Ÿฆ | Microsoftยฎ MVP | Power BI Consultant | Master Data Transformation ๐Ÿ‘‰ powerquery.how

    • Report this post

    Want to return multiple elements from a list based on their index positions? And wondering if #powerquery has a built-in function for this? ๐Ÿ”Sadly, the M language says โ€˜Noโ€™. ๐Ÿšซ๐Ÿ›  Real-World Scenarios:๐Ÿ”ถ Let's say you want to rename the 3rd and 5th columns in your query without having to specify the names manually.๐Ÿ”ถOr what if you have a function like List.PositionsOf that returns you the index numbers of the desired characters you want to retrieve.In both scenarios, a custom function is your knight in armour ๐Ÿ›ก. And I discovered that the List.Transform function can be a lifesaver in this regard.๐Ÿ“ I share with you 3 methods to get positions from a list. ๐ŸŽ BONUS: Take my custom function for this task.๐Ÿ”— Discover these methods and the custom function here: https://lnkd.in/eCydvh37

    3 Ways to Select List Items by Position in Power Query gorilla.bi

    108

    6 Comments

    Like Comment

    To view or add a comment, sign in

  • Fassahat Ullah Qureshi

    Senior Data Engineer | LinkedIn Top Data Engineering Voice | I help people land their first data analytics jobs | Data Mentor at Topmate | Highly Passionate about Data Analytics

    • Report this post

    Let me add some value to your lives by sharing a PDF Guide that shows some of the common features that ๐๐จ๐ฐ๐ž๐ซ ๐๐ˆ ๐ƒ๐€๐— ๐š๐ง๐ ๐๐จ๐ฐ๐ž๐ซ ๐๐ฎ๐ž๐ซ๐ฒ Offer.In this guide, we take a simple '๐˜š๐˜ข๐˜ญ๐˜ฆ๐˜ด๐˜‹๐˜ข๐˜ต๐˜ข' dataset as an example. ๐Ÿ’ช With ๐๐จ๐ฐ๐ž๐ซ ๐๐ฎ๐ž๐ซ๐ฒ, you can seamlessly filter, add new columns, or merge tables using a GUI. ๐Ÿ˜ฎ ๐ƒ๐€๐—, on the other hand, is your go-to for sophisticated calculations and aggregations.๐Ÿ” ๐๐ฎ๐ญ ๐ก๐ž๐ซ๐žโ€™๐ฌ ๐ญ๐ก๐ž ๐ซ๐ž๐š๐ฅ ๐ช๐ฎ๐ž๐ฌ๐ญ๐ข๐จ๐ง: ๐–๐ก๐ข๐œ๐ก ๐ญ๐จ๐จ๐ฅ ๐๐จ ๐ฒ๐จ๐ฎ ๐ซ๐ž๐š๐œ๐ก ๐Ÿ๐จ๐ซ ๐ฐ๐ก๐ž๐ง ๐Ÿ๐š๐œ๐ž๐ ๐ฐ๐ข๐ญ๐ก ๐š ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ฑ ๐๐š๐ญ๐š ๐œ๐ก๐š๐ฅ๐ฅ๐ž๐ง๐ ๐ž?Kind Regards,Fassahat#powerbi #powerquery #dax #daxfunctions

    5

    2 Comments

    Like Comment

    To view or add a comment, sign in

  • Chandeep Chhabra

    Power BI Trainer and Consultant

    • Report this post

    Here is an interesting #PowerQuery problem.I've got 2 tables.Table1 - Contains comma delimited letters. Each letter specifying a day of the week.Day Reference Table - Day of the week defined for each letter.Can you generate the expected Output? ๐ŸคŽBrownies for making it dynamic. ๐Ÿ˜

    • How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (40)

    180

    32 Comments

    Like Comment

    To view or add a comment, sign in

  • Rick de Groot

    I make Power Query easy for everyone ๐Ÿฆ | Microsoftยฎ MVP | Power BI Consultant | Master Data Transformation ๐Ÿ‘‰ powerquery.how

    • Report this post

    QuoteStyle.None vs QuoteStyle.Csv. This #powerquery enumeration puzzled me all weekend. ๐Ÿฅฒ Until I finally found out this.๐–๐ก๐ž๐ง ๐ข๐ญ'๐ฌ ๐ฎ๐ฌ๐ž๐QuoteStyle is a relevant enumeration related to working with text. It's used for + splitting strings+ combining columns+ extracting data from files. ๐–๐ก๐š๐ญ ๐ข๐ญ ๐๐จ๐ž๐ฌIn most cases when changing these values around, the results are identical. So I puzzled around, clueless of when it made a difference. But then I found out this. In some strings you may have double quotes. For example: ๐Ÿ’ "This is a ""string, in quotes"""๐Ÿ’  "He came to me and asked: """Where are you going?"""."QuoteStyle then determines whether to ignore content between the double-quotes or whether to respect it. The screenshot shows exactly the impact that has. You won't often need it, but now you can at least find the examples at PowerQuery How: https://lnkd.in/ea3EqTinPS. How was your weekend?#bigorilla #powerqueryeverything #powerqueryhow

    • How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (45)

    69

    17 Comments

    Like Comment

    To view or add a comment, sign in

  • Umbreen Siddique

    Data Engineer at TenX | Power BI | Snowflake | IBM Cognos | Talend | Data Stage | SSIS | SSAS | SSRS Developer

    • Report this post

    I have tested a simple Deneb custom visual on a Cherry Blossom Data Challenge and it turns out great.Deneb is a certified custom visual for #microsoftpowerbi, which allows developers to use the declarative JSON syntax of the Vega or Vega-Lite languages to create their own data visualizations.This is similar to the approaches used for creating R and Python visuals in Power BI, with the following additional benefits:โ—พ Libraries are packaged with the visual, so no additional dependencies on local libraries or gateways for your end-users when publishing reports.โ—พ Specifications are rendered inside the Power BI client, rather than being delegated to another location, typically resulting in faster render times for end-users.โ—พ Built for the web, meaning that it's possible to integrate with Power BI's interactivity features, with some additional setup.#deneb #datachallenge #powerbideveloper

    1

    Like Comment

    To view or add a comment, sign in

How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (51)

How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (52)

1,746 followers

  • 420 Posts

View Profile

Follow

Explore topics

  • Sales
  • Marketing
  • Business Administration
  • HR Management
  • Content Management
  • Engineering
  • Soft Skills
  • See All
How I used Powerquery M for Excel queries | Chris A. posted on the topic | LinkedIn (2024)
Top Articles
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 5649

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.