Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic X Axis based against Time

Hi All,

 

I have a requirement to show Gross Earned Premiums Vs Time (YYYYMM format) for last 30 months (including last Month). The X Axis show the time YYYYMM whcih is always 30 mins. How we can make the X Axis dynamically so that it will show alwasy 30 months. 

Right now  we are in March we have data loaded till Feb for Actuals. The Graph Should display data from 201609 till 201902. Once data is available for March 2019 the X axis should shift from 201610 till 201903.

 

Thanks ,

Sidhesh 

  • Hi Anonymous ,

     

    We can create a calualted column based on your time column like this.

     

    Column = DATE(LEFT(Table1[yyyymm],4),RIGHT(Table1[yyyymm],2),01)

    Regards,

    Frank

4 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi Anonymous ,

     

    We can create a measure and make the visual filtered by the measure as the picture below.

     

    Measure = var today =TODAY()
    var _date = MAX('Table'[Date])
    return
    IF(DATEDIFF(_date,today,MONTH)<=30,1,0)
    

     

    For more details, please check the pbix as attached.

     

    Regards,

    Frank

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Frank,

       

      Thanks for your reply, But I have the Time column in YYYYMM format whcih we have loaded the same in the fact table, we do not have any date column which we can use here, is it possible to here ?

       

      Thanks

      • v-frfei-msft's avatar
        v-frfei-msft
        Community Support

        Hi Anonymous ,

         

        We can create a calualted column based on your time column like this.

         

        Column = DATE(LEFT(Table1[yyyymm],4),RIGHT(Table1[yyyymm],2),01)

        Regards,

        Frank