Тёмный

Computing totals by summing visible values in DAX 

SQLBI
Подписаться 105 тыс.
Просмотров 74 тыс.
50% 1

This video shows how to compute a measure that sums the values produced row by row in the visual into the visual total, instead of recomputing the total value in the filter context of the total. Article and download: sql.bi/89870?aff=yt

Наука

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

 

24 авг 2020

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 58   
@cesart4257
@cesart4257 4 месяца назад
An absolute beast. SQLBI is really the best page out there for DAX. The fact this video was made 3 years ago is also insane. Congrats!
@visheshjjain
@visheshjjain 3 года назад
I was struggling for 3 days with this and it took me 2 mins after watching this to get what I needed. Thanks!!!
@allejulien645
@allejulien645 Год назад
This is probably one of the most usefull tutorial i've ever seen in my entire life, trully
@ericet19
@ericet19 3 года назад
Thank you for this, it solved my problem ! It feels like magic when everything adds up properly. Thanks again.
@oliveroshea5765
@oliveroshea5765 3 года назад
Excellent. Thank you Alberto and Marco for posting these videos
@OA-lx2zr
@OA-lx2zr Год назад
This is a life saver video.... Been having a problem with a particular report for days and this just saved me!!!!!!
@arturziolkowski1705
@arturziolkowski1705 Год назад
You saved me hours of trials. I'm happy that I found this video.
@misaelpadilla7012
@misaelpadilla7012 Год назад
I wasted a lot of time trying with summarize and then I found this video, just amazing
@mayuranpara4734
@mayuranpara4734 2 месяца назад
One of the best. Was struggling for couple of days. Thanks a lot.
@felipesignorellireis7839
@felipesignorellireis7839 3 года назад
That is exactly what i needed . Thanks Alberto.
@poorak3
@poorak3 28 дней назад
Great video! Helped me a lot. Thank you!
@thunderingravi
@thunderingravi 3 года назад
Thank you so much for the short video... This really helped me to solve my problem
@Tastenmann
@Tastenmann 2 года назад
Great elegant solution to my current issue 👍 Love you guys
@yannickfranckum6589
@yannickfranckum6589 3 года назад
Exactly what I was looking for! Thanks for sharing
@pedrohca
@pedrohca Год назад
This video is life saving! Thank you so much
@jisuskamilov
@jisuskamilov Год назад
Thanks for the video. I wish I could find this video before 3 days of suffering🙂
@sotork
@sotork 23 дня назад
Ciao Alberto, huge fan of your work here!...I think the video is repeated in the playlist.
@Dianamort09
@Dianamort09 5 месяцев назад
Thank you! I was able to figure it out because of this explanation 🎉
@JonatasBeque
@JonatasBeque 6 месяцев назад
You saved my day! Thank you so much!
3 года назад
Grazie Maestros!!! Grazie per Tutti !!
@Kmsbi
@Kmsbi 3 года назад
Thank you so much for sharing. you are awesome
@lucasgv
@lucasgv 2 года назад
Salved my life! Thanks a lot!
@jessamhan
@jessamhan 3 года назад
Hi Alberto, in the final expression around the 3:43 mark why is the outer CALCULATE necessary? Both the Sales Amount measure and the COUNTROWS expression are already embedded within one, so the context transition from the SUMX iterator will happen anyway.
@SQLBI
@SQLBI 3 года назад
True, the outer CALCULATE can be removed in this case. However, the good news is that the outer CALCULATE does not affect performance, it just makes the code more verbose and can be avoided.
@JonathanCHANAL
@JonathanCHANAL Год назад
Hi, I feel like the first CALCULATE is not useful here since the context transition is already there (use measure + other CALCULATE). What do you think of this code: COUNTROWS(FILTER('Date', 'Date'[Working Day]="Workday" && [Sales Amount])). Thanks
@nazmulalam2046
@nazmulalam2046 3 года назад
Thanks its helpful
@sivamani9752
@sivamani9752 3 года назад
Super, it would be helpful if you show how sort the columns based on the grand total in the bottom. Eg: left coulum with customer name, top columns are with few sales rep names and in the table it will have each sales reps sales amount for each customer, now i want to sort the sale rep based on the total sales done by each rep( total in the bottom)
@atullo1423
@atullo1423 6 месяцев назад
What would the PBI developers be without SQLBI. THANKS A LOOOTT!!!
@radicholakov9588
@radicholakov9588 2 года назад
Great video! It really helped me out. However I'm struggling to make it work when trying to iterate on more then one column by using summarize columns. Any tips how to make it work as if in the example placing the year and month in separate columns?
@SQLBI
@SQLBI 2 года назад
You should iterate the combination of the two columns - it requires an extra step, for this reason a single column with year and date is better (and it works also as hidden column, the user can choose two columns). The simpler, the better (and also the faster): SUMX ( VALUES ( 'Date'[YearMonth] ), ) SUMX ( SUMMARIZE ( 'Date', 'Date'[Year], 'Date'[Month] ), )
@joaquimcosta952
@joaquimcosta952 3 года назад
I already knew this calculation, but sometimes I like to review some calculations and I always come to the conclusion that many courses are inspired by your material. It is the path to immortality. I'm just sorry that the number of "LIKES" doesn't reflect the number of views. It is the least we can do to acknowledge the excellent work that Alberto and Marco have been doing for years and that many people have helped. How difficult can it be to make "LIKE" ???
@SQLBI
@SQLBI 3 года назад
Thanks!!
@goldwhispers
@goldwhispers 2 года назад
Do you have other videos similar to this, im stuck on a similar'ish problem. I am trying to average a division at the total level but its not working.
@itskshitijaa
@itskshitijaa Год назад
Hello Sir! This was insightful Thankyou! I however am facing an issue if anyone can help. You see, I have one Measure(Hrs Above Base) where I simply calculate difference between two other measures of the same table (Actual). Now, when the result of difference is negative I want to set it to zero. It is doing exactly this But then the Total seems to be incorrect still. I am iterating on the resources here. Am I missing anything here ?
@emilyamalkin4367
@emilyamalkin4367 Год назад
Ask your question on Power Bi Community site - you will get an immediate response (or several!)
@growlife4779
@growlife4779 2 месяца назад
Is there a way to do the following I created a measure to get proportion of sale per entity divided by the total sales across all entities. Then I wanted to create a measure called other that groups all entity sales that are below 3% into one summed up value. using alteryx what you can do is just a formula tool that can write new column called comment and get it to comment other in row if below 2% total sales and then just filter out comment other and sum it to get a one value called other. I was just trying to figure out how to sum of a measure that is not based on values in a table but also another measure? If i can create a calculated column that just pulls in the values when its below 3% I can just sum the column in that table. But as its a measure I cannot use a sum or sumx. I tried to get the measure into a calculated column but it won't let me because the rows have different values and it needs to be one.
@susantakumar8330
@susantakumar8330 3 года назад
Nice 👍
@mrgreenteatime2987
@mrgreenteatime2987 3 года назад
For all those people arriving from excel environment I wish you good luck a lot of petience :)
@aleksanderstrommer7677
@aleksanderstrommer7677 3 года назад
I am still waiting the day when I have fun with DAX...
@SQLBI
@SQLBI 3 года назад
Yes, you could use NOT ISBLANK ( ).
@mathew9665
@mathew9665 3 года назад
Nice - if you can have sales value of both positive and negative, I would presume your if condition instead of >0 would isnotblank ?
@SQLBI
@SQLBI 3 года назад
Yes you can use NOT ISBLANK ( )
@lionels839
@lionels839 Год назад
Hello Is the standard SUMMARIZE or ADDCOLUMNS + SUMMARIZE technique equivalent?
@SQLBI
@SQLBI Год назад
It's better to use ADDCOLUMNS+SUMMARIZE - see www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns/
@ExcelandPowerBISinhalen
@ExcelandPowerBISinhalen 3 года назад
How do you zoom in and out in Power BI?
@SQLBI
@SQLBI 3 года назад
You can use ZoomIt (free) or GlassBrick screen magnifier (licensed). We use both, depending on the context.
@ExcelandPowerBISinhalen
@ExcelandPowerBISinhalen 3 года назад
@@SQLBI Amazing Thank you very much.
@oliveroshea5765
@oliveroshea5765 3 года назад
@@SQLBI more context 😂
@DIGITAL_COOKING
@DIGITAL_COOKING 3 года назад
@@SQLBI yeah! , there is context for everything 🙂, great video Alberto you give me an idea about calculation i had in the past
@user-dh6wx3fe6y
@user-dh6wx3fe6y 3 месяца назад
but if ever we want to show this table say by weeks, not by months, we should create another measure?
@emmanuelagbo218
@emmanuelagbo218 7 месяцев назад
Having a date table with the min and max date of the sales table would have prevented this error. Though I learnt something new.
@lionels839
@lionels839 Год назад
Hello This formula does not work When you want to average visible values
@anshulroxx6791
@anshulroxx6791 2 года назад
But then your measure will only give the correct subtotals for the field defined in DAX VALUE() {Calendar Year Month} If we pull some other columns lets say Department level we will get incorrect totals. Whats your take on this?
@RichArd-ee2qj
@RichArd-ee2qj Год назад
Ahhhhhh...... Why does this work? I plagiarized the code. It corrected a similar problem I was having. Pax LY = SUMX ( VALUES ( '_Calendar'[Date] ), CALCULATE ( IF ( ISBLANK ( [Pax] ), BLANK (), CALCULATE ( [Pax], SAMEPERIODLASTYEAR ( _Calendar[Date] ) ) ) ) )
@dominikreim7723
@dominikreim7723 2 года назад
Best way is to use a Power Query generated Index column for the Values function
@markuzz1982
@markuzz1982 5 месяцев назад
Thanks a lot! Problem solved!
Далее
Computing a running total in DAX
5:05
Просмотров 66 тыс.
Row Context in DAX
20:42
Просмотров 95 тыс.
Don't make these CALCULATE Function Mistakes! ⚠️
10:09
Filter Context in DAX
16:03
Просмотров 69 тыс.
DAX Fridays! #25: Wrong Grand Totals in Power BI
9:25
When to use KEEPFILTERS over iterators
18:56
Просмотров 47 тыс.
DAX - Percent of Total vs Percent of Grand Total
9:06
Why Power BI totals might seem wrong
27:55
Просмотров 51 тыс.
Differences between GROUPBY and SUMMARIZE
28:30
Просмотров 35 тыс.