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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Patop
Frequent Visitor

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

@Patop , 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-tr...

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Patop , 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-tr...

Thank you!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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