Forum Discussion

STV's avatar
STV
Frequent Visitor
7 months ago
Solved

Display Current Month Range and Compare it with Previous Month Range

 

Team,

The below snapshot picture is the new requirement which I need to display on my dashboard.

Basically, I need to display the current month (say JAN 2026) and Compared with: previous month (say DEC 2025).

Also, pick the dates from the Calendar icon as shown in the picture.

Any help is appreciated.

 

 

Thanks,

STV

  • Hi STV,

    Thank you Irwan, techies, for your insights.

    You can achieve this in Power BI by using a standard date slicer for custom date selection, together with a disconnected comparison table and DAX measures to calculate the previous equivalent period dynamically. I’ve set up this method to provide flexible date selection and automatic previous-period comparison, and I’ve attached the PBIX file for your reference.

     

    Thank you.

8 Replies

  • hello STV 

     

    this is the best visual that i can do that match to your screenshot.

     

    there is no dashboard as your screenshot so you need to have some work around.

    1. create a measure for current month

    Desc1 =
    var _MinCal1 = EOMONTH(TODAY(),-1)+1
    var _MaxCal1 = EOMONTH(TODAY(),0)
    Return
    _MinCal1&" - "&_MaxCal1
    2. create a measure for selected slicer date
    Desc2 =
    var _MinCal2 = MIN('Calendar 2'[Date])
    var _MaxCal2 = MAX('Calendar 2'[Date])
    Return
    "Compared with: "&_MinCal2&" - "&_MaxCal2
    3. get a rectangular shape, then under Style option, go to text then conditional formating.

    4. in text conditional formating, choose Field value under Format style, then use the measure for current month.

    5. do the exact for the selected slicer date.
     
    Hope this will help.
    Thank you.
     
  • STV's avatar
    STV
    Frequent Visitor

    Irwan - Thanks a bunch for your help. It gave some idea on how to use the conditional formatting.

     

    Couple of questions:

    1.How are you able to display that tiny calendar icons

    2. How did you use both Desc1 and Desc2 in one rectangle shape.

     

    Sorry for the silly questions.

    • Irwan's avatar
      Irwan
      Icon for Super User rankSuper User

      hello STV 

       

      1. that is a between date slicer but if you resize small enough, it will show a between date without the slider

      2. that are two rectangular shape, each shape for one measure. because as far as my knowledge, concatenate command in pbi can not create a new line like alt+enter in excel, so we need to create two shape and place side-by-side.

       

      Hope this will help.

      Thank you.

  • Hi STV should the current vs previous month range appear as a header summary like this example?

     

     

     

     

  • Hi STV,

    Have you had a chance to review the solution we shared by Irwan techies? If the issue persists, feel free to reply so we can help further.

     

    Thank you.

    • STV's avatar
      STV
      Frequent Visitor

      Hi v-saisrao-msft, 

      Unfortunetly, the issue is still open. to be more specific, her is how it should look like when I click on the Calendar icon and would be able to select my own dates from the last month period. Appreciate your help.

       

       

      Thanks!

      • v-saisrao-msft's avatar
        v-saisrao-msft
        Icon for Community Support rankCommunity Support

        Hi STV,

        Thank you Irwan, techies, for your insights.

        You can achieve this in Power BI by using a standard date slicer for custom date selection, together with a disconnected comparison table and DAX measures to calculate the previous equivalent period dynamically. I’ve set up this method to provide flexible date selection and automatic previous-period comparison, and I’ve attached the PBIX file for your reference.

         

        Thank you.