cancel
Showing results for 
Search instead for 
Did you mean: 
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 IV
Super User IV

=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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.