Forum Discussion

thos123's avatar
thos123
Regular Visitor
10 years ago

How i can code DAX for display year?

How i can code DAX for display year?
Year (min month-max month) for this year
Ex. 2015 (Jan-Oct)

Thanks.

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    =CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE(FORMAT("yyyy",[Date])," ("),FORMAT("mmm",[Date])),"-"),FORMAT("mmm",[OtherDate])),")")

     

    Something like that. Need your orignal data to be sure.

    • thos123's avatar
      thos123
      Regular Visitor

      sorry I answered delay. I want to show like this.

      years201320142015(JAN-OCT)
      data111122223333

      My time data like this.

      Times_IDYearQuatorM-indexM-shortM-full_NameDayinMonth
      1201111JANJanuary31
      2201112FEBFebruary28
      3201113MARMarch31
      4201124APRApril30
      5201125MAYMay31
      6201126JUNJune30
      7201137JULJuly31
      8201138AUGAugust31
      9201139SEPSeptember30
      102011410OCTOctober31
      112011411NOVNovember30
      122011412DECDecember31

      Thanks.

      • LarsSchreiber's avatar
        LarsSchreiber
        Responsive Resident

        Hi thos123,

         

        I am not sure I got your question right. You already have the year in both tables (date table and fact table). So where do you want to "display" the year?! In a (pivot) table?! In that case you don't need to code DAX at all. Just use the column "year" of your date table?!?!

         

        Regards,

        Lars