Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
thos123
Regular 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.
5 REPLIES 5
Greg_Deckler
Super User
Super User

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

 

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


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

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

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.

Nazila
New Member

Sorry I posted in a wrong thread.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.