Forum Discussion

NJ81858's avatar
NJ81858
Helper IV
3 years ago
Solved

Different Dates for different visuals

Hello,

 

I am putting together a metrics report and I am having some issues with dates. I have 5 visuals that I want to display the data between certain dates, but the 6th visual I only want to display the data for the last date that is selected. For example:

 

The user wants to see data for the range of January through July. I want 5 visuals to show all numbers for that range, and the 6th I only want to display July data. 

 

Is this something that is possible? Also I apologize, I cannot share my .pbix file as it contains sensitive data. 

 

Thank you in advance!

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi NJ81858 ,

     

    Yes, it's possible. 

    You need a calendar table. You can create it using DAX.

    Calendar = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))

    Modify the two measures.

    Measure = IF(MAX('Table'[Date])>=MIN('Calendar'[Date])&&MAX('Table'[Date])<=MAX('Calendar'[Date]),1)
    Measure 2 = IF(MONTH(MAX('Table'[Date]))=MONTH(MAX('Calendar'[Date])),1)

    Based on the previous solution1, add a slicer of a calendar table to filter the date range.

     

     

     

    Best Regards,

    Stephen Tao

     

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

     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi NJ81858 ,

     

    Solution 1:

    You can use the filters to filter. In addition to fields that can be added to filter, measures can also be added.

    Measure = IF(MAX('Table'[Date])>=DATE(2022,1,1)&&MAX('Table'[Date])<=DATE(2022,7,31),1)

    After you add the measure into the visual-level filter, and set up show items when the value is 1, you'll see data for the range of January through July. And this is the visual 1. The other four visuals can also be set up like this.

     

    About the visual 6, you can create another visual below and add it into the visual-level filter of visual 6.

    Measure 2 = IF(MONTH(MAX('Table'[Date]))=7,1)

     

    Solution 2:

    You can change the interaction of the visuals. You can learn about it from the following document:

    Change how visuals interact in a report - Power BI | Microsoft Learn

     

     

    Best Regards,

    Stephen Tao

     

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

    • NJ81858's avatar
      NJ81858
      Helper IV

      Anonymous is there a way to make the first solution dynamic? So that is the user wants to see different months then the visual that shows the last month will change as well?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi NJ81858 ,

         

        Yes, it's possible. 

        You need a calendar table. You can create it using DAX.

        Calendar = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))

        Modify the two measures.

        Measure = IF(MAX('Table'[Date])>=MIN('Calendar'[Date])&&MAX('Table'[Date])<=MAX('Calendar'[Date]),1)
        Measure 2 = IF(MONTH(MAX('Table'[Date]))=MONTH(MAX('Calendar'[Date])),1)

        Based on the previous solution1, add a slicer of a calendar table to filter the date range.

         

         

         

        Best Regards,

        Stephen Tao

         

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