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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
manindes
Regular Visitor

Calendar Filter

Hello..,

if we have scenario like i have 3 years data.in that i want dates in single column like first year jan -nov,second year feb-oct,third year march-spt..

Thank you

1 ACCEPTED SOLUTION

Hi @manindes ,

 

Create a new Column

 

New Column = 

Var __month = Month(Dates[Date])
Var __year =  YEAR(Dates[Date])

RETURN

SWITCH(
    TRUE(),
    __year = 2015 && __month >=1 && __month <=11, "Jan - Nov" & " " & __year,
__year = 2016 && __month >=2 && __month <=10, "Feb - Oct" & " " & __year,
__year = 2017 && __month >=3 && __month <=9, "March - Sep" & " " & __year
)

 

Replace the 3 years with the years in ypur data.

 

Regards,

Harsh Nathani

 

View solution in original post

5 REPLIES 5
harshnathani
Community Champion
Community Champion

Hi @manindes ,

 

Please share more information as to what is needed.

 

Please see this post regarding How to Get Your Question Answered Quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

You should try creating a Date Table

Create a Date Table.

 

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

 

Also, incase you want column in same table, then create a Column

 

New Column =

 

Var __month = FORMAT('Table'[Order Date]. "mmm")

Var __year =  YEAR('Table'[Order Date])

 

RETURN

__month & __year

 

 

Regards,
Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Thanks for replay but it displaying error like

Too few arguments were passed to the FORMAT function. The minimum argument count for the function is 2

Hi @manindes ,

 

A typo mistake.

 

Try this

New Column = 
Var __month = FORMAT(Dates[Date], "mmm")
Var __year =  YEAR(Dates[Date])
RETURN

__month & " " & __year

 

 

Regards,

Harsh Nathani

Cap.JPG

thanks it's working but am looking like in above data

i have 3 years data.in that i want dates in single column like first year jan -nov,second year feb-oct,third year march-spt..

Hi @manindes ,

 

Create a new Column

 

New Column = 

Var __month = Month(Dates[Date])
Var __year =  YEAR(Dates[Date])

RETURN

SWITCH(
    TRUE(),
    __year = 2015 && __month >=1 && __month <=11, "Jan - Nov" & " " & __year,
__year = 2016 && __month >=2 && __month <=10, "Feb - Oct" & " " & __year,
__year = 2017 && __month >=3 && __month <=9, "March - Sep" & " " & __year
)

 

Replace the 3 years with the years in ypur data.

 

Regards,

Harsh Nathani

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.