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
ryan_b_fiting
Post Patron
Post Patron

Calculated Measure by month but only having start and end date

Hello Community - 

 

I have a fact table that houses all of my contracts and a date table.

My fact table is very basic and has contract, start date, end date and monthly cost (see below).

ContactIDContract StartContract EndMonthly Cost
11/1/202212/31/202245000
22/1/20221/31/202620000
33/21/20222/22/202410000
41/1/202212/31/202520000
51/1/202312/31/202615000

 

I am wondering what is the most efficient way to be able to show the total revenue (cost) by month throughout the life of the contracts.

For example with the sample data above I would want to be able to sum Total monthly cost by month for the 5 contracts and expect to see the following output:

MonthTotal Monthly Revenue
1/1/2022     65,000.00
2/1/2022     85,000.00
3/1/2022     85,000.00
4/1/2022     95,000.00
5/1/2022     95,000.00
6/1/2022     95,000.00
7/1/2022     95,000.00
8/1/2022     95,000.00
9/1/2022     95,000.00
########     95,000.00
########     95,000.00
########     95,000.00
1/1/2023   65,000.00
2/1/2023   65,000.00

 

Is there a simple way to do this even though I do not have every month listed out individually in my contract_fact table?

 

Thanks for any help!

Ryan

2 REPLIES 2
ryan_mayu
Super User
Super User

@ryan_b_fiting 

you can try to create a column

Column = sumx(FILTER('Table','Table (2)'[Month]>='Table'[Contract Start]&&'Table (2)'[Month]<='Table'[Contract End]),'Table'[Monthly Cost])

1.png

pls see the attachment below.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks @ryan_mayu I actually ended up using Power Query and using some M code to create the table I needed.  I will test this out though to see if it works for the issue as well.

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.