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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Revenue by Month, Start Date and End Date

Hi,

 

I have been attempting (somewhat sucessfully) to distribute revenue from hires over months.

 

I have a bunch of hire data with the following:

 

Hire Table:

AttributeTypes of Instances
Hire TypeH or L
Address Num#######
Asset Number####

Start Date

01/07/2020

End Date

05/09/2020

Weekly Rate

500

 

I also have a table called global dates, which contains every date in the finaincial year and month formated "yyyy-mm"

 

The below DAX formula has given me some sucess, however when I total it all, the numbers do not match the tally in the monthly figures.

 

RevInMonth = CALCULATE(
SUMX('Hire Table',
      (MIN('Hire Table'[End Date],LASTDATE('Global Dates'[Date])) -
      MAX('Hire Table'[Start Date], FIRSTDATE('Global Dates'[Date]))+1) * 'Hire Table'[User Amount] / 7
       ),
FILTER(
     'Hire Table',
      DATE( YEAR( 'Hire Table'[Start Date] ), MONTH( 'Hire Table'[Start Date]) , 1)
      <= FIRSTDATE( 'Global Dates'[Date])
&& (
       EOMONTH( 'Hire Table'[End Date], 0) >= LASTDATE('Global Dates'[Date])
       )
&& (
       'Hire Table'[W.O. Type] = "E"
)
)
)
 
 
Can anyone give me some advice on how to properly formulate this. Please bare in mind I need to catagorise by the type of hire and the address number (customer). Everywhere else i have looked at seems to only sumerise by month without any way of breaking down the revenue.
 
Many thanks in advance
1 ACCEPTED SOLUTION
2 REPLIES 2

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors