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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
drivero
Helper I
Helper I

How to measure days between dates when beginning and ending are in different months?

Hi all!

 

I have a problem with my project. I am using Analysis Service and a model based with Tabular Editor, but I attached here a simplified project with the problem I want to solve.

 

https://we.tl/t-ixwq5zsVDn 

 

I want to create a measure which counts the days wasted for each register since beginning until end. This is easy, but the problem appears when the beggining is in one month and the end in the other.

drivero_0-1681430754047.png

 


What I would like my Table visual do is: when selecting March, shows the value of Empleado 1 and the measure should count 13 days (from 1 to 13/03) and when selecting February, the measure should count 2 (27 and 28th February). The problem is that is only one register, I do not have two registers and I cannot create it. I need to use only this data, but when I filter visual by Month, as i already have a relationship between DimDate and Fecha de inicio, in March, the register disapear.

thanks in advance for your help 🙂

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

Is this what you are looking for?

Screen Capture #894.pngScreen Capture #895.pngScreen Capture #896.png

View solution in original post

12 REPLIES 12

thanks @Ahmedx 

it works with the sample file.

But when I use this measure with Tabular Editor in Analysis Service, i do not know why is not working. I deleted the relation between table "DimDate" and table "Ausencias" but the result of the measure is like the total, does not separete for each month. Is there anything am I missing? You have created a table "Table" in your pbi file, do I need to create it as well?
thanks for you help.

"...I need to create it as well?"
no i forgot to delete it

@Ahmedx any idea to use the same but in Analysis Service? because i cannot use parameters there

Do you have a desk calendar? instead of DimDate you can use your calendar

Ahmedx
Super User
Super User

that's excluding weekends

Screen Capture #897.png

Ahmedx
Super User
Super User

Is this what you are looking for?

Screen Capture #894.pngScreen Capture #895.pngScreen Capture #896.png

Yes, this is what I need. Both ways, including and excluding weekends. How did you do?

drivero
Helper I
Helper I

@Ahmedx is here, can you download it?
https://we.tl/t-ixwq5zsVDn 

drivero
Helper I
Helper I

Hello @Ahmedx 

 

I try it but it is still not working. Could you help me? Thanks.

Share sample pbix file to help you.

Ahmedx
Super User
Super User

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors