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.
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).
ContactID | Contract Start | Contract End | Monthly Cost |
1 | 1/1/2022 | 12/31/2022 | 45000 |
2 | 2/1/2022 | 1/31/2026 | 20000 |
3 | 3/21/2022 | 2/22/2024 | 10000 |
4 | 1/1/2022 | 12/31/2025 | 20000 |
5 | 1/1/2023 | 12/31/2026 | 15000 |
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:
Month | Total 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
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])
pls see the attachment below.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |