Close Menu
    Trending
    • High Paying, Six Figure Jobs For Recent Graduates: Report
    • What If I had AI in 2018: Rent the Runway Fulfillment Center Optimization
    • YouBot: Understanding YouTube Comments and Chatting Intelligently — An Engineer’s Perspective | by Sercan Teyhani | Jun, 2025
    • Inspiring Quotes From Brian Wilson of The Beach Boys
    • AI Is Not a Black Box (Relatively Speaking)
    • From Accidents to Actuarial Accuracy: The Role of Assumption Validation in Insurance Claim Amount Prediction Using Linear Regression | by Ved Prakash | Jun, 2025
    • I Wish Every Entrepreneur Had a Dad Like Mine — Here’s Why
    • Why You’re Still Coding AI Manually: Build a GPT-Backed API with Spring Boot in 30 Minutes | by CodeWithUs | Jun, 2025
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Artificial Intelligence»Advanced Time Intelligence in DAX with Performance in Mind
    Artificial Intelligence

    Advanced Time Intelligence in DAX with Performance in Mind

    FinanceStarGateBy FinanceStarGateFebruary 20, 2025No Comments19 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Everyone knows the standard Time Intelligence perform based mostly on years, quarters, months, and days. However typically, we have to carry out extra unique timer intelligence calculations. However we must always not overlook to contemplate efficiency whereas programming the measures. 

    Introduction 

    There are a lot of Dax features in Energy BI for Time Intelligence Measures. 

    The most typical are: 

    You will discover a complete checklist of Time Intelligence features right here: Time Intelligence – DAX Guide. These features cowl the commonest circumstances. 

    Nonetheless, some necessities can’t be simply lined with these features. And right here we’re. 

    I need to cowl a few of these circumstances I encountered in my tasks, which embrace: 

    • Final n Durations and a few variants 
    • How to deal with Leap years 
    • Week-to-Date calculations 
    • Calculating Weekly sums 
    • Fiscal Week YTD 

    I’ll present you easy methods to use an prolonged date desk to help these situations and enhance effectivity and efficiency. 

    Most Time-Intelligence features work no matter whether or not the Fiscal 12 months is aligned with the calendar yr. One exception is 12 months-to-Date (YTD). 

    For such circumstances, have a look at the DATESYTD() perform talked about above. There, you will discover the non-obligatory parameter to cross the final day of the Fiscal yr. 

    The final case will cowl calculations based mostly on weeks, whereas the Fiscal yr doesn’t align with the calendar yr. 

    Situation 

    I’ll use the well-known ContosoRetailDW information mannequin.

    The Base Measure is Sum On-line Gross sales, which has the next code: 

    Sum On-line Gross sales = SUMX('On-line Gross sales',
     ( 'On-line Gross sales'[UnitPrice]
                * 'On-line Gross sales'[SalesQuantity] ) 
                             - 'On-line Gross sales'[DiscountAmount] )

    I’ll work virtually completely in DAX-Studio, which supplies the Server Timing perform to research the efficiency of the DAX code. Within the References part beneath, yow will discover a hyperlink to an article about easy methods to gather and interpret efficiency information in DAX Studio. 

    That is the bottom question utilized in my examples to get some information from the info mannequin: 

    EVALUATE 
     CALCULATETABLE( 
     SUMMARIZECOLUMNS('Date'[Year] 
     ,'Date'[Month Short Name] 
    ,'Date'[Week] 
    ,'Date'[Date] 
    ,"On-line Gross sales", [Sum Online Sales] 
    ) 
     ,'Product'[ProductCategoryName] = "Computer systems" ,'Product'[ProductSubcategoryName] = "Laptops" 
    ,'Buyer'[Continent] = "North America" 
     ,'Buyer'[Country] = "United States"  ,'Buyer'[State/Province] = "Texas" )
    

    In most examples, I’ll take away some filters to get extra full information (for every day). 

    Date desk 

    My date desk features a comparatively massive variety of extra columns. 

    Within the references part beneath, yow will discover some articles written by SQLBI, on constructing weekly associated calculations, together with making a date desk to help these calculations. 

    As described in my article about date tables referenced beneath, I’ve added the next columns: 

    • Index or Offset columns to depend the times, weeks, months, quarters, semesters, and years from the present date. 
    • Flag columns to mark the present day, week, month, quarter, semester, and yr based mostly on the present date. 
    • This and the earlier columns require a each day recalculation to make sure the proper date is used because the reference date. 
    • Begin- and Finish-Dates of every week and month (Add extra if wanted). 
    • Begin- and Finish-Dates for the Fiscal 12 months. 
    • Earlier yr dates to incorporate the beginning and finish dates of the present interval. That is particularly fascinating for weeks, because the start- and finish dates of the weeks will not be the identical from yr to yr. 

    As you will notice, I’ll use these columns extensively to simplify my calculations.

    As well as, we’ll use the Calendar Hierarchy to calculate the wanted outcomes at completely different ranges of the hierarchy. 

    An entire Calendar hierarchy incorporates both: 

    1. 12 months 
    2. Semester 
    3. Quarter 
    4. Month 
    5. Day 

    Or 

    1. 12 months 
    2. Week 
    3. Day 

    If the Fiscal 12 months doesn’t align with the Calendar yr, I constructed the Hierarchy with the Fiscal 12 months as an alternative of the Calendar 12 months. 

    Then, I added a separate FiscalMonthName column and a FiscalMonthSort column to make sure that the primary month of the fiscal yr was proven first. 

    OK, let’s begin with the primary case. 

    Final n durations 

    This situation calculates the rolling sum of values over the previous n durations. 

    For instance, for every day, we need to get the Gross sales for the final 10 days: 

    Right here is the Measure I got here up with: 

    On-line Gross sales (Final 10 days) = 
     CALCULATE (
     [Sum Online Sales] 
     ,DATESINPERIOD ( 
     'Date'[Date], 
    MAX ( 'Date'[Date] ), 
    -10, 
    DAY 
     ) 
     ) 

    When executing the question filtering for Computer systems and North America, I get this consequence:

    Determine 2 – Final 10 days – Results of Measure (Determine by the Writer)

    If I have a look at the server timings, the consequence shouldn’t be dangerous: 

    Determine 3 – Server timings for the final 10 days Measure (Determine by the Writer) 

    As you’ll be able to see, the Storage engine performs greater than half of the work, which is an effective signal. It’s not good, however because the execution time is lower than 100 ms, it’s nonetheless excellent from the efficiency viewpoint. 

    This strategy has one essential situation:

    When calculating the rolling sum over a number of months, you will need to know that this strategy is date oriented. 

    Which means that if you have a look at a particular time, it goes again to the identical day of the given month. For instance: 

    We have a look at January 12. 2024, and we need to calculate the rolling sum during the last three months. The beginning date for this calculation might be November 13. 2023. 

    When can we need to get the rolling sum for the whole month? 

    Within the case above, I need to have because the beginning date November 1, 2023. 

    For this case, we will use the MonthIndex column. 

    Every column has a novel index based mostly on the present date. 

    Subsequently, we will use it to return three months and get the whole month. 

    That is the DAX Code for this: 

    On-line Gross sales rolling full 3 months = 
     VAR CurDate = 
     MAX ( 'Date'[Date] ) 
     VAR CurMonthIndex = 
     MAX ( 'Date'[MonthIndex] ) 
     VAR FirstDatePrevMonth = 
     CALCULATE ( 
     MIN ( 'Date'[Date] ), 
     REMOVEFILTERS ( 'Date' ), 
     'Date'[MonthIndex] = CurMonthIndex - 2 
     ) 
     RETURN 
     CALCULATE ( 
     [Sum Online Sales], 
     DATESBETWEEN ( 
     'Date'[Date], 
    FirstDatePrevMonth, 
    CurDate 
     ) 
     )

    The execution continues to be fast, however it’s much less environment friendly, as many of the calculations can’t be carried out by the Storage engine:

    Determine 4 – Server timings for the rolling sum of the final three full months (Determine by the Writer) As you’ll be able to see, it isn’t as quick as earlier than. 

    I attempted different approaches (for instance, 'Date'[MonthIndex] >= CurMonthIndex – 2 && 'Date'[MonthIndex] , however these approaches have been worse than this one. 

    Right here is the consequence for a similar logic, however for the final two months (To keep away from displaying too many rows):

    Determine 5 – Outcomes for the final two entire months (Determine by the Writer) 

    Relating to Leap Years 

    The bissextile year downside is odd, which is clear when calculating the earlier yr for every day. Let me clarify: 

    Once I execute the next Question to get the final days of February for the years 2020 and 2021: 

    EVALUATE 
    CALCULATETABLE ( 
     SUMMARIZECOLUMNS ( 
     'Date'[Year], 
     'Date'[Month Short Name], 
     'Date'[MonthKey],
     'Date'[Day Of Month], 
     "On-line Gross sales", [Sum Online Sales], 
     "On-line Gross sales (PY)", [Online Sales (PY)] 
     ), 
     'Date'[Year] IN {2020, 2021}, 
     'Date'[Month] = 2, 
     'Date'[Day Of Month] IN {27, 28, 29}, 
     'Buyer'[Continent] = "North America", 
     'Buyer'[Country] = "United States" 
    ) 
     ORDER BY 'Date'[MonthKey], 
     'Date'[Day Of Month]

    I get the next consequence: 

    Determine 6 – Drawback of each day PY for the yr after a bissextile year (Determine by the Writer) 

    As you’ll be able to see above, the consequence for February 28. 2020 is proven twice, and someday is lacking the February 2021 for On-line Gross sales (PY). 

    When wanting on the month, the sum is right: 

    Determine 7 – Right month-to-month sum with leap years (Determine by the Writer) 

    The issue is that there isn’t a February 29 in 2021. Subsequently, there isn’t a manner that the gross sales for February 29, 2020 might be displayed when itemizing the Gross sales Quantity per day. 

    Whereas the result’s right, it will likely be mistaken when the info is exported to Excel, and the values are summed. Then, the sum of the each day outcomes will differ from these proven for the whole month. 

    This could undermine the customers’ perceived reliability of the info. 

    My answer was so as to add a LeapYearDate desk. This desk is a duplicate of the Date desk however with no Date column. I added one row annually on February 29, even for non-leap years. 

    Then, I added a calculated column for every month and day (MonthDay): 

    MonthDay = ('LeapYearDate'[Month] * 100 ) + 'LeapYearDate'[Day Of Month]

    The Measure to calculate the earlier yr manually and utilizing the brand new desk is the next:

    On-line Gross sales (PY Leap 12 months) = 
     VAR ActYear = 
     SELECTEDVALUE ( 'LeapYearDate'[Year] ) 
     VAR ActDays = 
     VALUES ( 'LeapYearDate'[MonthDay] ) 
     RETURN 
     CALCULATE ( 
     [Sum Online Sales], 
     REMOVEFILTERS ( LeapYearDate ), 
     'LeapYearDate'[Year] = ActYear - 1, 
     ActDays 
     )

    As you’ll be able to see, I received the present yr, and through the use of the VALUES() function, I received the checklist of all dates within the present filter context. 

    Utilizing this methodology, my Measure works for single Days, Months, Quarters, and Years. The results of this Measure is the next: 

    Determine 8 – Consequence for the customized PY Measure, which all the time shows leap days (Determine by the Writer)

    As you’ll be able to see right here, the Measure may be very environment friendly, as many of the work is completed by the Storage engine:

    Determine 9 – Server Timings for the customized PY Measure for Leap years (Determine by the Writer) 

    However, to be trustworthy, I don’t like this strategy, regardless that it really works very nicely. 

    The reason being that the LeapYearDate desk doesn’t have a date column. Subsequently, it can’t be used as a Date desk for the present Time Intelligence features. 

    We should additionally use the calendar columns from this desk within the visualizations. We can not use the atypical date desk. 

    Consequently, we should reinvent all Time Intelligence features to make use of this desk.

    I strongly advocate utilizing this strategy solely when vital. 

    Week to Date and PY 

    Some Enterprise areas focus on Weekly evaluation. 

    Sadly, the usual Time Intelligence features don’t help weekly evaluation out of the field. Subsequently, we should construct our Weekly Measures by ourselves. 

    The primary Measure is WTD. 

    The primary strategy is the next: 

    On-line Gross sales WTD v1 = 
     VAR MaxDate = MAX('Date'[Date]) 
      
     VAR CurWeekday = WEEKDAY(MaxDate, 2) 
      
     RETURN 
     CALCULATE([Sum Online Sales] 
     ,DATESBETWEEN('Date'[Date] 
     ,MaxDate - CurWeekDay + 1  ,MaxDate) 
     )

    As you’ll be able to see, I take advantage of the WEEKDAY() function to calculate the beginning date of the week. Then, I take advantage of the DATESBETWEEN() function to calculate the WTD. 

    While you adapt this sample to your state of affairs, you will need to be certain that the second parameter in WEEKDAY() is ready to the proper worth. Please learn the documentation to be taught extra about it. 

    The result’s the next:

    Determine 10 – Consequence for WTD in DAX Studio (Determine by the Writer) 

    One other strategy is to retailer the primary date of every week within the Date desk and use this info within the Measure: 

    On-line Gross sales WTD PY v2 = 
     VAR DayOfWeek = MAX('Date'[Day Of Week]) 
      
     VAR FirstDayOfWeek = MIN('Date'[FirstDayOfWeekDatePY])   
     RETURN 
     CALCULATE([Sum Online Sales] 
     ,DATESBETWEEN('Date'[Date] 
     ,FirstDayOfWeek 
    ,FirstDayOfWeek + DayOfWeek - 1) 
     )
    

    The result’s exactly the identical. 

    When analyzing the efficiency in DAX Studio, I see that each Measures are comparable to one another:

    Determine 11 – On the left, you’ll be able to see the execution statistics for the primary model, and on the best, you see them for the second  model. As you’ll be able to see, each are very comparable (Determine by the Writer)

     

    I have a tendency to make use of the second, because it has higher potential when mixed with different Measures. However ultimately, it is determined by the present situation. 

    One other problem is to calculate the earlier yr. 

    Take a look at the next dates for a similar week in numerous weeks: 

    Determine 12 – Evaluating the dates of the identical week in numerous years. (Determine by the Writer) 

    As you’ll be able to see, the dates are shifted. And as the usual time intelligence features are based mostly on shifting dates, they won’t work. 

    I attempted completely different approaches, however ultimately, I saved the primary date of the identical week for the earlier yr within the date desk and used it like within the second model of WTD proven above: 

    On-line Gross sales WTD PY = 
     VAR DayOfWeek = MAX('Date'[Day Of Week]) 
      
     VAR FirstDayOfWeek = MIN('Date'[FirstDayOfWeekDatePY])   
     RETURN 
     CALCULATE([Sum Online Sales] 
     ,DATESBETWEEN('Date'[Date]
     ,FirstDayOfWeek 
    ,FirstDayOfWeek + DayOfWeek - 1) 
     )
    

    That is the consequence: 

    Determine 13 – Consequence for WTD PY Measure (Determine by the Writer) 

    Because the logic is similar as within the WTD v2, the efficiency can be the identical. Subsequently, this Measure may be very environment friendly. 

    Weekly Sums for PY 

    Generally, the weekly view is sufficient, and we don’t have to calculate the WTD on the Each day degree. 

    We don’t want a WTD Measure for this situation for the present yr. The bottom Measure sliced by Week can cowl this. The result’s right out of the field. 

    However, once more, it’s one other story for PY.

    That is the primary model I got here up with: 

    On-line Gross sales (PY Weekly) v1] = 
     VAR ActYear = MAX('Date'[Year]) 
      
     RETURN 
     CALCULATE([Sum Online Sales] 
     ,ALLEXCEPT('Date' 
     ,'Date'[Week] 
    ) 
     ,'Date'[Year] = ActYear - 1 
     )
    

    Right here, I subtract one from the present yr whereas retaining the filter for the present week. That is the consequence:

    Determine 14 – The consequence for WTD PY for the entire week. See that the WTD consequence for the final day of every week corresponds to the PY worth (Determine by the Writer) 

    The efficiency is sweet, however I can do higher. 

    What if I may retailer a novel Week Identifier within the Date column? 

    For instance, the Present Week is 9 of 2025.. 

    The Identifier could be 202509. 

    Once I detract 100 from it, I get 202409, the identifier for a similar week within the earlier yr. After including this column to the date desk, I can change the Measure to this: 

    MEASURE 'All Measures'[Online Sales (PY Weekly) v2] = 
    VAR WeeksPY = VALUES('Date'[WeekKeyPY]) 
    RETURN 
    CALCULATE([Sum Online Sales]
    ,REMOVEFILTERS('Date') 
    ,'Date'[WeekKey] IN WeeksPY 
    )
    

    This model is way easier than earlier than, and the consequence continues to be the identical. 

    After we evaluate the execution statistics of the 2 variations, we see this: 

    Determine 15 – Evaluating the execution statistics of the 2 variations for WTD PY for the entire week. On the left is V1, and on the best is V2. (Determine by the Writer) 

    As you’ll be able to see, the second model, with the precalculated column within the Date desk, is barely extra environment friendly. I’ve solely 4 SE queries, a superb signal for elevated effectivity. 

    Fiscal Weeks YTD 

    This final one is difficult. 

    The requirement is that the person needs to see a YTD ranging from the primary day of the primary week of the Fiscal yr. 

    For instance, the Fiscal yr begins on July 1. 

    In 2022, the week containing July the 1st begins on Monday, June 27. 

    Which means that the YTD calculation should begin on this date. 

    The identical applies to the YTD PY calculation beginning Monday, June 28, 2021. 

    This strategy has some penalties when visualizing the info. 

    Once more, figuring out if the consequence should be proven on the day or week degree is important. When displaying the info on the day degree, the consequence might be complicated when choosing a Fiscal 12 months:

    Determine 16 – Results of the weekly based mostly YTD for the Fiscal yr 22/23 (Determine by the Writer) 

    As you’ll be able to see, Friday is the primary day of the Fiscal yr. And the YTD consequence doesn’t begin on July 1st however on Monday of that week. 

    The consequence is that the YTD doesn’t appear to start out appropriately. The customers should know what they’re . 

    The identical is legitimate for the YTD PY outcomes. 

    To facilitate the calculations, I added extra columns to the Date desk: 

    • FiscalYearWeekYear—This discipline incorporates the numerical illustration of the Fiscal yr (for 23/24, I get 2324), beginning with the primary week of the Fiscal yr. 
    • FiscalYearWeekYearPY – The identical as earlier than, however for the earlier yr (FiscalYearWeekYear – 101). 
    • FiscalWeekSort—This sorting column begins the week with the primary day of the fiscal yr. A extra elaborate manner to make use of this column could possibly be to comply with the ISO-Week definition, which I didn’t do to maintain it more straightforward. 
    • FiscalYearWeekSort – The identical as earlier than however with the FiscalYearWeekYear in entrance (e. g. 232402). 
    • FirstDayOfWeekDate – The date of the Monday of the week during which the present date is in.

    Right here is the Measure for the Each day YTD:

    On-line Gross sales (Fiscal Week YTD) =
    VAR FiscalYearWeekYear = MAX('Date'[FiscalYearWeekYear])
    VAR StartFiscalYear = CALCULATE(MIN('Date'[Date])
    ,REMOVEFILTERS('Date')
    ,'Date'[FiscalYearWeekSort] =
    
    FiscalYearWeekYear * 100 + 1
    
    )
    
    VAR FiscalYearStartWeekDate = CALCULATE(MIN('Date'[FirstDayOfWeekDate])
    ,ALLEXCEPT('Date'
    ,'Date'[FiscalYearWeekYear]
    )
    ,'Date'[Date] = StartFiscalYear
    
    )
    VAR MaxDate = MAX('Date'[Date])
    RETURN
    CALCULATE([Sum Online Sales]
    ,REMOVEFILTERS('Date')
    
    ,DATESBETWEEN('Date'[Date]
    ,FiscalYearStartWeekDate
    
    ,MaxDate
    )

    Right here is the DAX Code for the Each day YTD PY:

    On-line Gross sales (Fiscal Week YTD) (PY)] =
    VAR FiscalYearWeekYear = MAX('Date'[FiscalYearWeekYear])
    -- Get the Week/Weekday at the beginning of the present Fiscal 12 months
    VAR FiscalYearStart = CALCULATE(MIN('Date'[Date])
    ,REMOVEFILTERS('Date')
    ,'Date'[FiscalYearWeekSort] =
    
    FiscalYearWeekYear * 100 + 1
    )
    VAR MaxDate = MAX('Date'[Date])
    -- Get the variety of Days for the reason that begin of the FiscalYear
    VAR DaysFromFiscalYearStart =
    DATEDIFF( FiscalYearStart, MaxDate, DAY )
    -- Get the PY Date of the Fiscal 12 months Week Begin date
    VAR DateWeekStartPY = CALCULATE(MIN('Date'[Date])
    ,REMOVEFILTERS('Date')
    ,'Date'[FiscalYearWeekSort] =
    
    (FiscalYearWeekYear - 101) * 100 + 1
    )
    RETURN
    CALCULATE(
    [Sum Online Sales],
    DATESBETWEEN(
    'Date'[Date],
    DateWeekStartPY,
    DateWeekStartPY + DaysFromFiscalYearStart
    
    )
    )

    As you’ll be able to see, each Measures comply with the identical sample: 

    1. Get the present Fiscal 12 months. 
    2. Get the Beginning Date of the present Fiscal 12 months. 
    3. Get the Beginning date of the week beginning the Fiscal 12 months. 
    4. Calculate the Consequence based mostly on the Distinction between these two dates 

    For the PY Measure, one extra step is required: 

    • Calculate the times between the beginning and present dates to calculate the proper YTD. That is vital due to the date shift between the years. 

    And right here is the DAX code for the weekly base YTD: 

    On-line Gross sales (Fiscal Week YTD) =
    VAR FiscalWeekSort = MAX( 'Date'[FiscalWeekSort] )
    -- Get the Week/Weekday at the beginning of the present Fiscal 12 months
    VAR FiscalYearNumber = MAX( 'Date'[FiscalYearWeekYear] )
    
    RETURN
    CALCULATE(
    [Sum Online Sales],
    REMOVEFILTERS('Date'),
    'Date'[FiscalYearWeekSort] >= (FiscalYearNumber * 100 ) + 1
    && 'Date'[FiscalYearWeekSort] 

    For the weekly YTD PY, the DAX code is the next: 

    On-line Gross sales (Fiscal Week YTD) (PY) =
    VAR FiscalWeekSort = MAX( 'Date'[FiscalWeekSort] )
    -- Get the Week/Weekday at the beginning of the present Fiscal 12 months
    VAR FiscalYearNumberPY = MAX( 'Date'[FiscalYearWeekYearPY] )
    RETURN
    CALCULATE(
    [Sum Online Sales],
    REMOVEFILTERS('Date'),
    'Date'[FiscalYearWeekSort] >= (FiscalYearNumberPY * 100) + 1
    && 'Date'[FiscalYearWeekSort] 

    Once more, each Measures comply with the identical sample: 

    1. Get the present (Type-) variety of the week within the Fiscal yr.
    2. Get the beginning date for the fiscal yr’s first week.
    3. Calculate the consequence based mostly on these values.

    The consequence for the weekly based mostly Measure is the next (On the weekly degree, as the worth is the identical for every day of the identical week): 

    Determine 17 – Consequence for the primary three weeks per Fiscal 12 months with the weekly based mostly YTD and PY Measure (Determine by the Writer) 

    When evaluating the 2 Approaches, the Measure for the weekly calculation is extra environment friendly than the one for the each day calculation:

    Determine 18 – Evaluating the execution statistics for the 2 Measures. On the left is the each day, and on the best is the weekly calculation. They’re the identical for the calculation for the present and the earlier yr (Determine by the Writer) 

    As you’ll be able to see, the Measure for the weekly result’s quicker, has a extra good portion executed within the Storage Engine (SE), and has fewer SE queries. 

    Subsequently, it may be a good suggestion to ask the customers in the event that they want a WTD consequence on the day degree or if it’s sufficient to see the outcomes on the week degree. 

    Conclusion 

    While you begin writing Time Intelligence expressions, contemplate whether or not extra calculated columns in your date desk might be useful. 

    A rigorously crafted and prolonged date desk might be useful for 2 causes: 

    • Make Measures simpler to write down 
    • Enhance the efficiency of the Measures 

    They are going to be simpler to write down as I don’t have to carry out the calculations to get the middleman outcomes to calculate the required outcomes. 

    The consequence of shorter and easier Measures is healthier effectivity and efficiency. 

    I’ll add increasingly columns to the template of my date desk as I encounter extra conditions during which they are often useful. 

    One query stays: Find out how to construct it? 

    In my case, I used an Azure SQL database to create the desk utilized in my examples. 

    But it surely’s doable to create a date desk as a DAX desk or use Python or JavaScript in Material or no matter information platform you employ. 

    Another choice is to make use of the Bravo device from SQLBI, which lets you create a DAX desk containing extra columns to help unique Time Intelligence situations. 

    References 

    You will discover extra details about my date-table here. 

    Learn this piece to discover ways to extract efficiency information in DAX-Studio and easy methods to interpret it. 

    An SQLBI article about constructing a date desk to help weekly calculations: Utilizing weekly calendars in Power Bi – SQLBI 

    SQLBI Sample to carry out additional weekly calculations: 

    Week-related calculations – DAX Patterns 

    Like in my earlier articles, I take advantage of the Contoso pattern dataset. You’ll be able to obtain the ContosoRetailDW Dataset without cost from Microsoft here. 

    The Contoso Information might be freely used beneath the MIT License, as described here.

    I modified the dataset to shift the info to modern dates. 



    Source link
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleComprehensive Guide to Feature creation in Data Science: From Basics to Super Advanced Techniques 3 | by Adnan Mazraeh | Feb, 2025
    Next Article Free Webinar | March 11: 3 Biggest Mistakes Entrepreneurs Make (And How to Fix Them)
    FinanceStarGate

    Related Posts

    Artificial Intelligence

    What If I had AI in 2018: Rent the Runway Fulfillment Center Optimization

    June 14, 2025
    Artificial Intelligence

    AI Is Not a Black Box (Relatively Speaking)

    June 13, 2025
    Artificial Intelligence

    Boost Your LLM Output and Design Smarter Prompts: Real Tricks from an AI Engineer’s Toolbox

    June 13, 2025
    Add A Comment

    Comments are closed.

    Top Posts

    How AI Is Redefining Education and the Future of Work

    April 30, 2025

    The National Institute of Standards and Technology (NIST) is a U.S. | by Carolecameroninge | Mar, 2025

    March 15, 2025

    ViT from scratch. Foreword | by Tyler Yu | May, 2025

    May 9, 2025

    🏡 One City, 5,000 Properties, 12,800 Models — The Hidden Complexity Behind “Just Predicting House Prices” | by SOURAV KUMAR | Apr, 2025

    April 12, 2025

    Compression Algorithms: How To Zip Files & Save Space | by AirLab Media | Apr, 2025

    April 6, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    Master the 3D Reconstruction Process: A Step-by-Step Guide

    March 28, 2025

    JPMorgan Releases Summer Book List for Wealthy People

    May 31, 2025

    How AI Is Transforming Creative Industries: From Art to Music to Writing | by AI With Lil Bro | May, 2025

    May 8, 2025
    Our Picks

    How a Firefighter’s ‘Hidden’ Side Hustle Led to $22M in Revenue

    June 1, 2025

    Agentic GraphRAG for Commercial Contracts

    April 3, 2025

    Effortless Spreadsheet Normalisation With LLM

    March 15, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.