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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
apuype
Frequent Visitor

DatesInPeriod within Selected Value Range

Hi all!

 

Looking for assistance for a scenario that my brain thinks as simple but I cannot get the dax no matter which way I try it. 

I have a basic table with time off requests 

apuype_0-1678139054544.png


I need to calculate leave length totals - which I can do, however the next layer to that is leave length totals within a selected date range

For example if I I look at the month of February I do not want the value for user ABC to be 41, I only want it to be 28 days for 02/01/23-02/28/23 - so how much time off was within the month of February.

I have done many custom time intelligence formuals due to some custom calendars but this one has me stumped. 


Thank you! 

2 REPLIES 2
apuype
Frequent Visitor

Thank you, this is making sense to me for when a user is only using a month slicer. The slicer I am using gives a period and then using that period there is a start and end date

apuype_0-1678203344869.png

 

I have a special dates table to account for what period each date falls in, I then have that related to our main date table which holds the unique values and that then relates to my data

apuype_1-1678203418533.png


Thinking I could do something with your logic above that involves using my start of this period, end of this period measures? 

Thanks again! I will be saving your measure above for when I am working with standard periods. 

Padycosmos
Solution Sage
Solution Sage

Hope this measure helps:

Padycosmos_0-1678142077682.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.