Forum Discussion

heygowtam's avatar
heygowtam
Helper II
3 years ago
Solved

Dax for Auto Change

I am working on the Dashboard which is Season Based 

for Example - Financial Year 2021 - Season 20, the Finacial year 2022 = Season 21, 
Financial Year is from July to June 

Dax Below - 

Season 21 = CALCULATE(SUM('All Seasons'[Bales]),'All Seasons'[season] = 21,'All Seasons'[Parent Company] = "AWN")
/
(CALCULATE(SUM('All Seasons'[Bales]), 'All Seasons'[season]= 21))


is there anyway that we can  make Season to  automate on or after July 1st of every year Season number steps up by 1 
  • Hi heygowtam ,

     

    You can use the method that Anonymous mentioned.

    like this:

    Add a column:

    All Seasons =
    ADDCOLUMNS (
        CALENDAR ( DATE ( 2019, 1, 1 ), TODAY () ),
        "Financial Year",
            IF ( MONTH ( [Date] ) >= 7, YEAR ( [Date] ) + 1, YEAR ( [Date] ) )
    )
    

     

    If your data refreshed, the DAX code will follow it to refresh.

     

    Hope this helps you.

     

    Best Regards,

    Community Support Team _Yinliw

    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,


    Add a season column to your date table with the appropriate season 

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

      Hi heygowtam ,

       

      You can use the method that Anonymous mentioned.

      like this:

      Add a column:

      All Seasons =
      ADDCOLUMNS (
          CALENDAR ( DATE ( 2019, 1, 1 ), TODAY () ),
          "Financial Year",
              IF ( MONTH ( [Date] ) >= 7, YEAR ( [Date] ) + 1, YEAR ( [Date] ) )
      )
      

       

      If your data refreshed, the DAX code will follow it to refresh.

       

      Hope this helps you.

       

      Best Regards,

      Community Support Team _Yinliw

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