DATEDIFF, YEARFRAC - DAX Guide

  Рет қаралды 7,653

SQLBI

SQLBI

Күн бұрын

Пікірлер
@Milhouse77BS
@Milhouse77BS 3 жыл бұрын
I like how the results of each line returned in a table. I might use to compare different measures when refactoring.
@uade129989
@uade129989 3 жыл бұрын
How can i manage business day Alberto? thanks for your videos. Gracias!
@Bharath_PBI
@Bharath_PBI 3 жыл бұрын
Thank you 👍
@rusi.rusev01
@rusi.rusev01 3 жыл бұрын
Very nice! How can you make datediff in business days or excluding holidays? I guess including calendar table somehow?
@SQLBI
@SQLBI 3 жыл бұрын
See these articles and samples: www.sqlbi.com/articles/counting-working-days-in-dax/ www.sqlbi.com/blog/alberto/2011/01/19/working-days-computation-in-powerpivot/ www.sqlbi.com/tools/dax-date-template/
@matteoagliocchi3268
@matteoagliocchi3268 3 жыл бұрын
Any way to calculate working days between the two dates?
@SQLBI
@SQLBI 3 жыл бұрын
See this article+video: www.sqlbi.com/articles/counting-working-days-in-dax/
@beginho2454
@beginho2454 3 жыл бұрын
Hello Alberto, Microsoft announced the GPT-3 can help us write the measures easily? did you use it?
@SQLBI
@SQLBI 3 жыл бұрын
It's a feature that Microsoft announced but not released, we cannot comment until we try it.
@beginho2454
@beginho2454 3 жыл бұрын
@@SQLBI let me follow the DAX Guru's tips. thanks your team. ;)
@bladoblado
@bladoblado 3 жыл бұрын
Hi, Love your Chanel. I struggle everytime i need to calculate the time elapsed from two different date+ times (Start and end) for our service orders or Sales . Usually i do on powerquery and use duration types, with a lot of programming, but i feel i dont do it right and extremely over complicated. And tips? Dax or M?
@SQLBI
@SQLBI 3 жыл бұрын
In reality you are doing well because the same calculation in DAX is more expensive. DAX works well on aggregations or in row-level calculations - computing the difference in dates between different rows related to the same order and repeating the same process for every order is computationally expensive and it's better to do that preparing data in advance.
@emanueleruggiero8011
@emanueleruggiero8011 2 жыл бұрын
Ciao Alberto, and congrats for the channel. I stumbled across the famous challenge of calculating the age of customers starting from their birthday. I came up with the below DAX code. So far I could not find any shortcomings with this approach. Do you know if use cases exist when this code won't return the right value? customer_age = SWITCH( -- TRUE, // Set conditions for relationship between current date and customer's birthday // Case when this year's birthday did not happen yet MONTH(TODAY()) < MONTH('Customer Lookup'[birthdate]) || MONTH(TODAY()) = MONTH('Customer Lookup'[birthdate]) && DAY(TODAY()) < DAY('Customer Lookup'[birthdate]), YEAR(TODAY()) - YEAR('Customer Lookup'[birthdate]) - 1, // Case when this year's birthday happened already MONTH(TODAY()) > MONTH('Customer Lookup'[birthdate]) || MONTH(TODAY()) = MONTH('Customer Lookup'[birthdate]) && DAY(TODAY()) >= DAY('Customer Lookup'[birthdate]), YEAR(TODAY()) - YEAR('Customer Lookup'[birthdate]) ) Thank you!
@SQLBI
@SQLBI 2 жыл бұрын
Read this blog post about that specific problem (the video was about the DAX functions only): www.sqlbi.com/blog/marco/2018/06/24/correct-calculate-of-age-in-dax-from-birthday/
Optimizing nested iterators in DAX
17:31
SQLBI
Рет қаралды 22 М.
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
My number 1 trick for TIME INTELLIGENCE  | Power BI DAX
11:13
How to Power BI
Рет қаралды 59 М.
Differences between GROUPBY and SUMMARIZE
28:30
SQLBI
Рет қаралды 43 М.
DAX for Power BI Part 6.2 - Comparing Date Ranges
37:45
WiseOwlTutorials
Рет қаралды 6 М.
DAX Fridays! #17: DATEDIFF
12:08
Curbal
Рет қаралды 34 М.
Making DAX Easy
20:01
How to Power BI
Рет қаралды 224 М.
Differences between ALL and ALLCROSSFILTERED
12:47
SQLBI
Рет қаралды 1,4 М.
EARLIER Function in DAX
15:46
Goodly
Рет қаралды 44 М.