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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Carlo1975
Helper I
Helper I

Calculation of Quartes

Hi everyone, I have a problem, that is, I should calculate the quarters with respect to connected columns. The columns are Name, first date and second date.I think that is very difficult, but I try to explain

  • The First and the second Date aren’t in order
  • 2) The quarter is equal to 0 as long as the first date is less than the second date. After that, when the first date is equal to or greater than the second date, I start counting the quarters based on the first date. In the example 30/06/2018 is the date to start calculating the first quarter and in fact it is equal to 1. After the 3 months, in the example it is 30/10/2018 it becomes quarter 2 .... so until the end
  • When the name changes, we start from scratch again.
NameFirst DateSecond DateQuarter
XXXX31/05/201830/06/180
XXXX31/05/201830/06/180
XXXX30/06/201830/06/181
XXXX30/06/201830/06/181
XXXX30/06/201830/06/181
XXXX31/10/201830/06/182
XXXX31/10/201830/06/182
YYYYYYYY31/05/201830/06/180
YYYYYYYY31/05/201830/06/180
YYYYYYYY31/05/201830/06/180

 

Thank you

Carlo

2 REPLIES 2
amitchandak
Super User
Super User

@Carlo1975 , Create a new column like

Switch( true(),
[First Date]<[Second Date], 0 ,
[First Date]=[Second Date], 1 ,
[First Date]>[Second Date], 2
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I'm sorry but is wrong...if you look my example, when the first date is 30/10/2018, the quarter is 2, but, if for example I have also another data like 31/01/2019, the quarter will be 3, and if I have also 31/04/2019 the quarter will be 4....and so on until the name change. Each 3 month, from the first date is equal or greater than the second date, I have to add 1 (quarter 1, quarter 2, quarter 3, quarter 4, quarter 5, etc.)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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