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
AlexG16261626
New Member

Best Approach to Create a Trimester date label?

Hello! I have a standard [Date] column and create trimesters for a graph. What would be the best approach to create a Trimester value/label? I was considering create an entirely new date table, but I think a simple new measure/column would be easier to achieve this.

 

I was thinking of a calculation along the lines of IF [Date] between January 1 - April 30 then "Trimester 1" ELSEIF date between May 1 - August 31 then "Trimester 2" etc. etc. but was having trouble thinking of the proper construction of this new column. 

 

 

Thanks!

1 ACCEPTED SOLUTION

@AlexG16261626 
Better to do that on a month number column, so:

 

Trimester = 
SWITCH(
    TRUE(),
    'Date'[Month Number] <= 4, 1, 
    'Date'[Month Number] <= 8, 2, 
    3
)

 

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

5 REPLIES 5
SpartaBI
Community Champion
Community Champion

@AlexG16261626 your approach is the right one. What issue are you facing?

I'm trying to think of which functions to use in this calculation.

@AlexG16261626 
Better to do that on a month number column, so:

 

Trimester = 
SWITCH(
    TRUE(),
    'Date'[Month Number] <= 4, 1, 
    'Date'[Month Number] <= 8, 2, 
    3
)

 

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Ahhhh, I'm coming over from Tableau so I wasn't well-versed in SWITCH, thank you!

@AlexG16261626 my pleasure 🙂 and welcome to the best tool 🙂
P.S. Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. Please give it a thumbs up over there if you liked it 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543

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.