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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Between two dates

Hello,

I have a column with date of begning and a column with a date of end.

 

I would like to create a report where I can see depending of the quarter of the years how many row are between those two dates.

For exemple how many rows have a date of begining before the fist quarter of 2021 and a date of end after the first quarter of 2021.

Hence I will be abble to know depending to the different quarter of the year how many row was between those dates.

A row can be count in the first quarter and in the second one, it will depends when the date of end will be.

 

To do that I start creting column called Q1_2021, Q2_2021...Q4_2021 where I put a 1 if the row has started but not ended during the corresponding quarter of 2021 or a 0 if it wasnt the case.

Hence I have 4 columns with the values 0 or 1, corresponding to the differents quarters.

I would like to have in the lines my quarters and in the columns the amount of row that are still active (the start date before the quarter and the end date after the quarter). But I can't achieve it. I only sucess to put my quarter in the columns and the amount in the lines. Could you help me pls?

Thank you

 

I would like somethink like this

Patop_0-1650015653150.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Using independent date table

 

new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = mainx(allselected(Date1),Date1[Date])
return

calculate(count(Table[case]), filter(Table, Table[Start_date] <= _max && table[EndDate] >=_min))

 

Also, check

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Using independent date table

 

new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = mainx(allselected(Date1),Date1[Date])
return

calculate(count(Table[case]), filter(Table, Table[Start_date] <= _max && table[EndDate] >=_min))

 

Also, check

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

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
Anonymous
Not applicable

Thank you!

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.