Forum Discussion
thos123
10 years agoRegular Visitor
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.
Greg_Deckler
10 years agoCommunity 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
10 years agoRegular Visitor
sorry I answered delay. I want to show like this.
| years | 2013 | 2014 | 2015(JAN-OCT) |
| data | 1111 | 2222 | 3333 |
My time data like this.
| Times_ID | Year | Quator | M-index | M-short | M-full_Name | DayinMonth |
| 1 | 2011 | 1 | 1 | JAN | January | 31 |
| 2 | 2011 | 1 | 2 | FEB | February | 28 |
| 3 | 2011 | 1 | 3 | MAR | March | 31 |
| 4 | 2011 | 2 | 4 | APR | April | 30 |
| 5 | 2011 | 2 | 5 | MAY | May | 31 |
| 6 | 2011 | 2 | 6 | JUN | June | 30 |
| 7 | 2011 | 3 | 7 | JUL | July | 31 |
| 8 | 2011 | 3 | 8 | AUG | August | 31 |
| 9 | 2011 | 3 | 9 | SEP | September | 30 |
| 10 | 2011 | 4 | 10 | OCT | October | 31 |
| 11 | 2011 | 4 | 11 | NOV | November | 30 |
| 12 | 2011 | 4 | 12 | DEC | December | 31 |
Thanks.
- LarsSchreiber10 years agoResponsive 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
- thos12310 years agoRegular Visitor
Sorry for late answer.
I want to show month name in year label because the data is as of last month in 2015, not whole year.
Thanks.