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

Measure: Calculating months between End Date to today

I created new measure to calculate no. of months between End Date to today but the issue:

1- Nothing appear in the dashboard

2- due-passed end date not show as -number (-3, -5..etc)

 

# of Months = SUMX(IncrementalImprovement, Datediff([fls_ActualEndDate], TODAY(), DAY)
 
 

Capture.JPG

 
 

 

 

 

 

8 REPLIES 8
PaulDBrown
Community Champion
Community Champion

Sorry, I'm not following. Can you provide a dummy PBIX file via a file sharing service?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Please see below my data set including two tables (Projects {Project Name-Remaining Budget}

and (Incrementalimprovments {Actual End Date})<< this field I used in the Date Diff measure

GhadaMehrez_2-1659437992129.png

 

GhadaMehrez_1-1659436894572.png

 

GhadaMehrez_0-1659436681956.png

 

 

PaulDBrown
Community Champion
Community Champion

PLease provide sample data or PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






here in the sample, I created an excel sheet as data set the same as my data model as it gets the data from the power PPM platform.

in the sample of excel it works fine but in my original dashboard I have the failure

https://drive.google.com/file/d/1m3b_PdAxJ89MDKVJ9G23tPhVXAcJ2Lxi/view?usp=sharing

 

Thanks for the file. Can you please explain what you need to calculate for the visual?

This measure returns the number of months between the month end date and current month:

 

Month diff = 
DATEDIFF(MAX('Table'[End Date]), TODAY(), MONTH)

 

Month diff.png

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






thanks that's what exactly I need but I don't know why in the original dashboard the values do not appear in the scatter chart as below:

GhadaMehrez_0-1659380347893.png

 

By default, the x-axis covers the range defined by the {Month diff] measure:

default.pngTo avoid this, you can use the formatting options for the axis by defining new max an min values for the range.

range.png

 

In my example, I've extended one month at each end of the range using the following meaures for each end of the range:

 

 

 

Min Month Range = 
MINX('Table', [Month diff]) -1
MAX Month Range = 
MAXX('Table', [Month diff]) +1

 

 

 

Which delivers this:

result.png

 

You might even consider inverting the x-axis so that the "future" months (-ve values) are on the right of the visual as follows (which I actually thinks makes more sense):

invert.png

Or perhaps change the order of the DATEDIFF so that the past months are negative vs today (today - x months), which entails changing the max and min for the range?

past -ve.png

 

I've attached the sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks for your effort It works in the sample chart but for my original chart I did all the steps you advised but still values not visible, IS it maybe because I work in the original dashboard on two tables(one for Projects and another one for customer calculation including the Actual End Date field)???

 

 

 

GhadaMehrez_0-1659432484890.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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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