Forum Discussion

JohnFetherolf's avatar
JohnFetherolf
Frequent Visitor
5 years ago
Solved

Time Intelligence is not working

I cannot get the time intelligence functions to work. I've been working with Power BI for years, so I do have some experience. Here is some background/detail info:

 

I've scaled back the data model so there are only two tables: Calendar and Orders. The orders table has an Invoice date that I joined to the calendar table - which is marked as the date table.

 

Steps I've taken

  1. Added Matrix to the report with rows set to the date from the calendar table
  2. Created a measure: Sales = sum('Orders'[Net Sales])
  3. Created a measure: Rows = COUNTROWS('Calendar')
  4. Set the Values in the Matrix = Sales and the Rows

This validated that I had values for the various invoice dates - basically every Monday thru Friday. And I had a row for every day in the calendar - all 365 days for 2021

 

When I create the measure: 

YTD Sales = CALCULATE([Sales],DATESYTD('Calendar'[Full Date]))

This works - It calculates the correct value for all the sales in 2021

 

When I create the measure: 

MTD Sales = CALCULATE([Sales],DATESMTD('Calendar'[Full Date]))

It does not work; it shows (Blank) when I add it to a Card

 

I've tried other functions and none of them works for the Month calculations. I'm clueless to what to try next. I would appreciate any help

  • Hi JohnFetherolf ,

     

    The first thing to confirm is to check the data model to observe whether the calculated sales of the current month has a corresponding value. If the value is empty, blank will be returned. If this is not the reason, check whether the Full Date field type can count the month.

     

    If it is not the above problem, can you provide test data (delete sensitive information) and more information for me to do further testing. 

    If you can’t provide further test data, you can check the official documentation for the use of the DATESMTD function and similar solutions, hoping to help you.

     

     

    Let me know the result immediately, looking forward to your reply.

    Best Regards,
    Henry

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • What's the reasoning behind step #3 ?

     

    What do you expect to show on the card visual?

     

    Please post some sample orders data (across multiple months)

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi JohnFetherolf ,

     

    The first thing to confirm is to check the data model to observe whether the calculated sales of the current month has a corresponding value. If the value is empty, blank will be returned. If this is not the reason, check whether the Full Date field type can count the month.

     

    If it is not the above problem, can you provide test data (delete sensitive information) and more information for me to do further testing. 

    If you can’t provide further test data, you can check the official documentation for the use of the DATESMTD function and similar solutions, hoping to help you.

     

     

    Let me know the result immediately, looking forward to your reply.

    Best Regards,
    Henry

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • JohnFetherolf's avatar
      JohnFetherolf
      Frequent Visitor

       

      Here is an image the canvas. As you can see, the MTD sales is displayed as (Blank) in the Card visual. However, in the Matrix, you can see there is sales for March (the current month) and in the table, there are several rows with March 2021 dates.

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi JohnFetherolf ,

     

    Check if the solution provided by this link can help you solve the problem.


    Let me know the result immediately, looking forward to your reply.

    Best Regards,
    Henry

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • JohnFetherolf's avatar
      JohnFetherolf
      Frequent Visitor

      I found the issue yesterday. My calendar had dates for all of 2021. When I removed the futures, the DATESMTD and TOTALMTD worked. This explains why the DATESYTD and TOTALYTD worked - the calendar did not have future years.