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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
que
Regular Visitor

Create Months Columns to Calculate number of days between 2 dates

I have 2 dates:  Start Date = March 23, 2023  End Date = March 23, 2025.  I can calculate total number of days for the term - 731, count between Start and end which allows be to calc a daily revenue, is there a way to have BI recognize the months individually to allow for a monthly calc on revenue.  Because the dates don't always start on the 1st and end on the last day of the month I can't quite get the logic on how to make this work.  It can work with a date count table for the full months but not partial.  

 

March 2023 = 8 x daily revenue

April 2023 = 30 x daily revenue

May 2023 = 31 x Daily revenue

4 REPLIES 4
BrianConnelly
Resolver III
Resolver III

So, you need to provide some sample data and expected results.  The short answer is yes, but there is not enough context to your question for the community to help you based on what has been provided.  In most cases we would be using variables also we would need to know how the measure and visual would be applied.

Sorry, I am new!  I hope I did this right.  I can make it work in excel using:  =IF(MEDIAN(G$1,H$1,$F2)=$F2,((H$1-$F2)/DAY(H$1))*$D2,IF(MEDIAN($E2,$F2,H$1)=H$1,IF(MEDIAN($E2,G$1,H$1)=$E2,(H$1-$E2)/DAY(H$1)*$D2,$D2),0)).  This calculates the first month (December, from the actual start date.  Does this make sense?  Just trying to replicate in BI and get this out of excel.

Deal NameDuration (Months)Duration DaysExpected RevenueStart DateContract End Date31-Oct-2230-Nov-2231-Dec-2231-Jan-23
Deal One12365$ 5,000.00Dec 15, 202212/15/2023  $             -   $      2,581 $     5,000
Deal Two12365$ 37,500.00May 12, 20235/11/2024  $             -   $            -   $           -  
Deal Three12365$ 25,000.00Feb 10, 20232/10/2024  $             -   $            -   $           -  

Does this look right to you?

BrianConnelly_0-1676428482688.png

 

Hi Brian, indeed it does look correct.  I just can't seem to translate that same formula in BI.  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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