Тёмный

Thinking about your DAX Queries like a SQL Query in Power BI 

Guy in a Cube
Подписаться 452 тыс.
Просмотров 99 тыс.
50% 1

Coming to Power BI with SQL experience? Trying to learn DAX? Patrick shows you how to think about your DAX Queries like a SQL Query in Power BI. We hope this helps you to create DAX Queries that are much more accurate and effective!
📢 Become a member: guyinacu.be/me...
*******************
Want to take your Power BI skills to the next level? We have training courses available to help you with your journey.
🎓 Guy in a Cube courses: guyinacu.be/co...
*******************
LET'S CONNECT!
*******************
-- / guyinacube
-- / awsaxton
-- / patrickdba
-- / guyinacube
-- / guyinacube
-- guyinacube.com
**Gear**
🛠 Check out my Tools page - guyinacube.com...
#PowerBI #DAX #GuyInACube

Опубликовано:

 

21 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 96   
@eziola
@eziola 8 месяцев назад
Amazing! Do a whole playlist on DAX Queries. I think it is the most effective way to learn DAX / think in DAX! Thank you and keep em coming!
@eziola
@eziola 7 месяцев назад
I recently ran into an issue where I had to choose between: EVALUATE SUMMARIZECOLUMNS FILTER... FILTER... versus EVALUTE SELECTCOLUMNS( CALCULATETABLE(table, [filter condition], [filter conditoin],) Both approaches returned the same result, but were very different in memory usage. The SELECTCOLUMNS(CALCULATETABLE) seems to be the way to go.
@gerryboy458
@gerryboy458 8 месяцев назад
Brilliant. What would be even better is if we could use an actual SQL query directly thus be able to leverage all that SQL expertise.
@PeteBlake-h9v
@PeteBlake-h9v 2 месяца назад
Thank you Patrick, explaining how to handle that pesky "Query(1,1) The expression specified in the query is not a valid table expression" message. This was driving me nuts 'cause I didn't understand why it was occurring and wasn't able to find good explanation for it. Made my day. Thanks again.
@mwaltercpa
@mwaltercpa 8 месяцев назад
So many benefits to this. I love that it’s in the app… I can build in the view, then materialize as a new dim table. It’s also a great way to learn DAX, and simplify the work your measures have to do in the report :) Love it.
@soy_leche
@soy_leche 8 месяцев назад
Would be interested to learn more on this in a slower and more detailed format. This seems to be a lot more complex than SQL for the same queries but would be good to know this.
@StephanieNelson-z8m
@StephanieNelson-z8m 8 месяцев назад
AH HA moment!! I've been having trouble with DAX because I think in SQL...this connects the dots for sure!
@jurakovtun6763
@jurakovtun6763 Месяц назад
Wow, unbelievable quality of the video. The design, transitions and of course, the host! Thank you so much for your work! ❤
@thomasivarsson1291
@thomasivarsson1291 8 месяцев назад
Braces {} are important i noticed. Code with light colour on a light background.
@GaryThomann-CoGC
@GaryThomann-CoGC 2 месяца назад
Thank for dax studio. If you want to display a list of measures then use the following construct EVALUATE { CONVERT( MAX( 'table'[measure] ), STRING ) & UNICHAR(10) & CONVERT( MAX( 'table'[measure] ), STRING ) }
@jessesmith4051
@jessesmith4051 8 месяцев назад
The timing of this video was uncanny. Thanks so much for this.
@GuyInACube
@GuyInACube 8 месяцев назад
BAM! 👊
@Herr_Vorragender
@Herr_Vorragender 8 месяцев назад
Upfront; I have never used PowerBI. And so I'm sitting here thinking why would I want yet another syntax to "replace" SQL? Maybe it's better or faster somehow. Or maybe I can't use SQL in PowerBI. But in the latter case, whouldn't it have been wiser to integrate the classic SQL syntax into PowerBI? I bet it has something to do with the other DAX capabilities.
@Tom-kp2lv
@Tom-kp2lv 8 месяцев назад
Dax is more powerful and versatile? @Pactrick, is that correct?
@Herr_Vorragender
@Herr_Vorragender 8 месяцев назад
@@Tom-kp2lv what does "more powerful" mean? If PowerBI connects to a MSSQL from where it fetches the data, there is absolutely no way it technically be quicker or less resource hungry. If more powerful means that it has more functions to use, then Java would be even more powerful than DAX. What do you think?
@Tom-kp2lv
@Tom-kp2lv 8 месяцев назад
@@Herr_Vorragender I'll defer to Patrick or others with more expertise. I only know some SQL and some Dax, my reply was just speculation.
@GuyInACube
@GuyInACube 8 месяцев назад
DAX is the calculation expression language within Power BI. More folks understand SQL than understand DAX. But, if you are creating measures or certain things in Power BI, you have to use DAX. The transition can be painful sometimes to understand. This video is about how you can think about DAX if you are coming in with SQL knowledge. Of course, transformations should always be done further upstream. Those things should be done in SQL if possible, and assuming that's the data source. You still would have a need to create calculation measures though. Which is where DAX would come in.
@GuyInACube
@GuyInACube 8 месяцев назад
@Tom-kp2lv it depends 😎 SQL has it's place and is further upstream. But once your semantic model is in place, you will need to create DAX measures for use within visuals. We always say to do data transformations are far upstream as possible. And, when it comes to your specific data, you should be testing for performance to see what gets you better results.
@alexscorer1
@alexscorer1 8 месяцев назад
i dont understand why we even need dax.. sql would be much more seamless imo
@otavioalves813
@otavioalves813 8 месяцев назад
DAX was created specifically for tabular models. It has a different approach than sql and several advantages over it.
@milpatel83
@milpatel83 8 месяцев назад
DAX is terrible, quite frankly. I'd urge anyone to just concentrate on SQL and use DAX sparingly. This is my new years resolution.
@sweydert
@sweydert 8 месяцев назад
Lol As a business consultant and DAX pro, I've worked with SQL pros everyday for several years. I seldom use manual SQL myself because DAX opens up a universe of dynamic, interactive reporting possibilities that are several orders of magnitude more powerful than anything you could produce manually in SQL. DAX is like splitting the SQL atom, unleashing unfathomable power. I make far more money than my SQL-centric peers because of this. If you're using DAX and not making at least twice what a SQL pro makes, you're not using it correctly.
@antoniogonzalez3143
@antoniogonzalez3143 8 месяцев назад
@@sweydert “splitting the SQL atom”, this really encapsules the power that DAX brings, but most people don’t need that much power, or cannot use it correctly if their data model isn’t correct. DAX shines best with complex calculations
@komanguy
@komanguy 8 месяцев назад
Since DAX runs in a certain filter context, Sql would have been confusing. Imagine an sql statement in what you don’t need a where statement because the context is already filtered!
@simonvaughan5654
@simonvaughan5654 8 месяцев назад
Amazing stuff Patrick, I always learn something new from each of your videos
@GuyInACube
@GuyInACube 8 месяцев назад
Great to hear! Thanks for watching 👊
@RobertLJ11
@RobertLJ11 8 месяцев назад
Thank you for the video. This video came right on time. I am attempting to make the mental jump from SQL to DAX and this video is a great help. I'm looking forward to any other trips or tricks you post in the future. 👍🎉🎁
@GuyInACube
@GuyInACube 8 месяцев назад
Awesome to hear! We also had to make that jump from SQL to DAX. It took time. When we made the connection to think about it like a SQL query - it changed our perspective.
@elrevesyelderecho
@elrevesyelderecho 8 месяцев назад
3:40 nice! Didn't know it! 😮
@lopypop
@lopypop 8 месяцев назад
Can you do another video using M like a SQL query? (Power Query is the place I'm most likely to think about data in terms of querying vs DAX is where I'm thinking about building measures)
@GuyInACube
@GuyInACube 8 месяцев назад
Will take a look. It's a very different approach.
@melodym5993
@melodym5993 8 месяцев назад
Thank you!! It's getting close to transact SQL!! AWESOME!!!😊
@georgebob2268
@georgebob2268 8 месяцев назад
Awesome video. This has sparked my mind to figure out new ways to use the power of DAX!
@GuyInACube
@GuyInACube 8 месяцев назад
Great to hear! Thanks for watching!
@KoundinyaPulipaka
@KoundinyaPulipaka 8 месяцев назад
Please let me know after getting the results. What should we do, is it only for analysis if we can utilize the results.
@ElderCruz
@ElderCruz 3 месяца назад
It would be awesome if someday in the future you could create DAX notebooks integrated in Power BI Desktop, just like Jupyter Notebooks with Python or similar to RStudio
@kostaskolotouros4345
@kostaskolotouros4345 3 месяца назад
Awesome video. Planning to use DAX Studio more often, so thank you!
@Tom-kp2lv
@Tom-kp2lv 8 месяцев назад
Love this (and your enthusiasm about it). One thing, it sounds a bit echo-y - like the room is very "live".
@kaushalpatel426
@kaushalpatel426 8 месяцев назад
this is going to be crazy.
@nagendrakg5062
@nagendrakg5062 8 месяцев назад
Q: I hope if Microsoft comes up with a tool that converts the sql to Dax then would be game changer
@Ni3Bhosale
@Ni3Bhosale 4 месяца назад
Q: Brilliant video, I must say very informative. I write VBA macros but want to get expertise in PowerBI DAX Queries.. Is it right to say that i learn SQL queries and then start my hands on on POWERBI? please advise
@dbszepesi
@dbszepesi 8 месяцев назад
I really don't want to talk about how long I have been using Rows() instead of just using the table constructor '{}' that I just learned about in this video.
@GuyInACube
@GuyInACube 8 месяцев назад
We learn something every day! 👊
@ikar2k
@ikar2k 8 месяцев назад
That's so true for me too, bro. 👍😅
@JBartlett_DMU
@JBartlett_DMU 8 месяцев назад
I still don't understand why we have to write EVALUATE at the beginning of every DAX query. If all queries must begin with EVALUATE, then the interpreter should automatically add it at runtime if necessary.
@yosoylucernario
@yosoylucernario 8 месяцев назад
Most of the times you'll start an expression with DEFINE, where you'll define measures and table expressions that you'll use in the EVALUATE expr ssion.
@JBartlett_DMU
@JBartlett_DMU 8 месяцев назад
@@yosoylucernario Then if there are no DEFINE statements, it should still assume the EVALUATE statement.
@jorrellbonner5303
@jorrellbonner5303 2 месяца назад
This was great vid, Patrick!!!
@aravindsampath3223
@aravindsampath3223 8 месяцев назад
wow this looks amazing, cant wait to try it out
@elrevesyelderecho
@elrevesyelderecho 8 месяцев назад
2:35 nice! 😮😮 Didn't know it
@GuyInACube
@GuyInACube 8 месяцев назад
BAM! 👊
@floricapitu
@floricapitu 8 месяцев назад
This looks amazing, thank you! ❤
@aleksvpYT
@aleksvpYT 8 месяцев назад
Fantastic video!!! All I ever wanted!
@michaelandreini2920
@michaelandreini2920 8 месяцев назад
Hi, loved the video so helpful. I don't know if you have created one but I run into issues where the dataset becomes so large when pulling into the model, it takes so long to refresh. Do you have any content around optimizing the data retrieval to either get all that data or for a sub-set of that data? Thank you!
@sachinr6042
@sachinr6042 8 месяцев назад
Incredible!.. Thanks for sharing
@irwinchawla7209
@irwinchawla7209 8 месяцев назад
Great feature!! Thanks for sharing.
@Brian-vs9sd
@Brian-vs9sd 3 месяца назад
I would love a sql to dax converter. I'm new to dax and my head hurts.
@nataschalaros418
@nataschalaros418 2 месяца назад
Is it possible to make DAX code visible (as tooltip eg) for users?
@asn85uk
@asn85uk 6 месяцев назад
Hello, thank you for the helpful video. I'm encountering a scenario where I require the use of a subquery. Specifically, I need to retrieve all sales from the salestbl where the customers match those in a distinct list obtained from the customer table. However, I'm facing difficulties implementing this query in Power BI due to the presence of date filters in both the inner and outer queries. While SSRS allows the use of date variables for start and end dates, Power BI seems to struggle with the date range in the inner query. Could you provide guidance on how to address this issue using DAX or M-query? Your assistance would be greatly appreciated. Thank you.
@toulasantha
@toulasantha 8 месяцев назад
Bring in a magic command to DAX where we can chose DAX/SQL
@Phoenixspin
@Phoenixspin 8 месяцев назад
I wish I was cool like Patrick.
@l3ol3lca
@l3ol3lca 8 месяцев назад
Nice! But Dax Studio now have more futures that you need.
@LouisYassa
@LouisYassa 4 месяца назад
I wonder why MS chose this nonintuitive DAX syntax vs just plain sql!
@ajay22111
@ajay22111 8 месяцев назад
Thank you so much amazing
@deeswift-z1h
@deeswift-z1h 7 месяцев назад
Hi Guy in a cube, Can I've amazon rds for psql , redshift and crowd twist connect to my same report How many data sources can I connect to my power bi report, do you have a video?
@Believer_karma
@Believer_karma 7 месяцев назад
how to use power bi on MacBook Air?
@NestorAdrianzen
@NestorAdrianzen 8 месяцев назад
This is bananas! 🍌🍌🍌
@GuyInACube
@GuyInACube 8 месяцев назад
We agree! 👊
@franciscoribeiro2030
@franciscoribeiro2030 8 месяцев назад
Can you use this as tables you create in the model or is the goal of this pure testing and analysis of data?
@yosoylucernario
@yosoylucernario 8 месяцев назад
You can use table expressions to add a calculated tables to your model.
@UU-ry6gt
@UU-ry6gt 8 месяцев назад
awesome! as usual you make us very keen to research more on this topic!
@DarwinSwimsWithTheFish
@DarwinSwimsWithTheFish 8 месяцев назад
#GeauxTigers 🐅
@samratrsc
@samratrsc 8 месяцев назад
This is cool
@JohnnyWinter-p8r
@JohnnyWinter-p8r 8 месяцев назад
Yooooo! So I've been writing DAX as a query language since way back in my SSAS days, when you had to write it in a plain text editor (no intellisense :o) in order to use it in SSRS reports. One question though... I've always used a different syntax to this - partly because TREATAS didn't even exist back in the day. Instead, I wrap my SUMMARIZECOLUMNS in a CALCULATETABLE, which then allows you to pass a psuedo-WHERE clause as a list in the 2nd argument. eg: EVALUATE CALCULATETABLE ( SUMMARIZECOLUMNS ( 'Calendar'[Month], "Total Freight", [M1] ), 'Calendar'[Year] = 2020 ) Is there anything wrong with this alternate syntax? I always found it more intuitive to write my filter predicates as a final step, more like SQL... but I'm the only person I know who seems to do this and have never figured out whether or not my method is egregious.
@ashleyeatsmuffins
@ashleyeatsmuffins 7 месяцев назад
I'm new to DAX and so can't properly answer you question. However my initial thoughts are that: 'Readability' trumps ' 'cleaner' Code' Often readability that colleagues will understand can be better than having the same result written in less lines but being less obvious what is going on - explicitly showing the predicate and even it being encapsulated in CALCULATETABLE (rather than the {} constructor brackets I just learned about in this video) makes it easier to understand. The only reason I would (sometimes) argue against this would be for performance reasons, and I'm afraid I can't help answer whether your code could be less performant than other methods!
@ashleyeatsmuffins
@ashleyeatsmuffins 7 месяцев назад
Side note, I double checked the meaning of Egregious before repeating it and found the old definition funny: ADJECTIVE outstandingly bad; shocking: "egregious abuses of copyright" SIMILAR: shocking, horrific, horrifying, horrible, terrible, awful ARCHAIC remarkably good.
@damn68
@damn68 8 месяцев назад
Beautiful
@ifyluv7402
@ifyluv7402 8 месяцев назад
Interesting
@Nalaka-Wanniarachchi
@Nalaka-Wanniarachchi 8 месяцев назад
Yo .DAX and SQL Duo.
@brettyc
@brettyc 8 месяцев назад
DAX > SQL because of context & data model
@HSGG_
@HSGG_ 2 месяца назад
why record with potato..
@echezonaazubike8054
@echezonaazubike8054 8 месяцев назад
This is not SQL 😆
@GuyInACube
@GuyInACube 8 месяцев назад
You are correct. It is DAX. Patrick was talking about how to think about DAX like a SQL query for those coming from SQL.
@mauricioalvarez4230
@mauricioalvarez4230 7 месяцев назад
No even close to SQL
@tonymiller225
@tonymiller225 19 дней назад
{TREAT AS} SWEET AZZ
@trabek123
@trabek123 Месяц назад
SAR MARKET TO FULLY BULLISH HOGAYA HAI AAJ TO LOSS HOGA AAPKA XD
@Emiliosguay
@Emiliosguay 8 месяцев назад
DAX studio is dead jaja amazing new functionality
@MikeRudzinski-n6q
@MikeRudzinski-n6q 7 месяцев назад
DAX Studio does a whole lot more than just writing queries. My main use is for quick and easy access to DMVs, and also looking at metrics (VPAX). Theses features are essential for large models and the Power BI query editor doesn't cover these areas.
Далее
Handling MULTIPLE fact tables in Power BI
9:02
Просмотров 310 тыс.
🎙ПОЮ для ТЕБЯ ВЖИВУЮ!🍁
3:12:31
Просмотров 437 тыс.
O’zim bilib ketvotudima😅
01:00
Просмотров 749 тыс.
Unique deep painful back massage for Lisa #chiropractor
00:11
How I Use SQL as a BI Analyst
9:01
Просмотров 26 тыс.
Build a TOGGLE BUTTON Like a PRO in Power BI
14:06
Просмотров 189 тыс.
Happy little accidents with the Power BI Card Visual
8:47
Filter context in DAX explained visually
24:40
Просмотров 23 тыс.
Row context in DAX explained visually
21:45
Просмотров 14 тыс.
3 Hacks to Work Faster in Power BI
25:39
Просмотров 66 тыс.
10X Your Excel Skills with Copilot
12:51
Просмотров 309 тыс.
🎙ПОЮ для ТЕБЯ ВЖИВУЮ!🍁
3:12:31
Просмотров 437 тыс.