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
GhadaMehrez
Helper III
Helper III

Data Modeling-Measure between Start and End Date

Could help me to add new measure calculating the difference between Start and End Date in years and months.

 

11 REPLIES 11
amitchandak
Super User
Super User

@GhadaMehrez , there are few ways.

refer: https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

refer attached files after signature can help?

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Actually this so confusing to me especially since I'm new to using Power BI but I found this measure and it works well to calculate no. month between Start and End Date:

No.of months= SUMX(Orders, DATEDIFF(Orders[End Date],Orders[Start Date],month))

 

but the problem here is I want to calculate the number of month between the End Date and Today (Month remains to today) any help please  to add a measure for that 

 

 

Anonymous
Not applicable

Hi   @GhadaMehrez ,

Please update the formula of the measure [] as below and check if it can get your expected result...

No.of months = SUMX ( Orders, DATEDIFF ( Orders[End Date], TODAY ()MONTH )

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards

Thanks a lot I created this measure but when I put the X Axis as No of Month measure the projects don't appear in the chart

Could you guide me how to attache PBIX

 

GhadaMehrez_0-1658755857427.png

 

Anonymous
Not applicable

Hi @GhadaMehrez ,

You can refer the following link to upload the file to the community. Before sharing the file, please remove the sensitive info in your file. Thank you.

How to upload PBI in Community

Best Regards

Anonymous
Not applicable

Hi @GhadaMehrez ,

When try to open the shared file, I got the following error message... Could you please create a separate simplified report file: use Enter data method to create the quries and create visual which can be enough to illustrate your problem.

yingyinr_0-1658824290643.png

Best Regards

Anonymous
Not applicable

Hi @GhadaMehrez ,

I updated your sample pbix file(see attachment), please check if that is what you want. Please toggle on "Category label" tab.

yingyinr_0-1658918257730.png

Best Regards

in the original copy it is on but still nothing appear in dashboard 

GhadaMehrez_0-1658921481406.png

 

@Anonymous please as you see here I still cannot see any data in the dashboard but when I clear the x-axis the data appear

any help how to fix it 

and for the measure for the passed due dates it is not calculated as (-) any way how to update the measure 

 

GhadaMehrez_0-1659271924345.png

 

Thanks a lot 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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