Forum Discussion
Visualization for contract start/end dates and cost
I have several entries, each with the fields: organization name, contract start date, contract end date, and contract amount. I am trying to create a visual that will display organization contracts and their amount over time using start dates and end dates as the axis bounds, contract amount as the value, and the organization name as the legend.
Is there a method to display data in this fashion within BI? I have attached a couple of manually-created example images that better explain what I'm trying to do. Please note how "Organization B" has aggregated contract values over the same timeframe and Organizations "C" and "D" have certain timespans with no effective contracts.
Any pointers would be appreciated! Thanks.
Hi kiranbrao,
You can create a calendar table:
Calendar = CALENDAR(MIN('Table1'[Contract start date]),MAX('Table1'[Contract end date]))
Then create a measure in fact table:
Amount = CALCULATE(SUM('Table1'[Contract amount]),FILTER('Table1','Table1'[Contract start date]<=MAX('Calendar'[Date]) && 'Table1'[Contract end date]>=MAX('Calendar'[Date])))
Please check attached .pbix file.
Best Regards,
Qiuyun Yu
13 Replies
- v-qiuyu-msft
Community Support
Hi kiranbrao,
You can create a calendar table:
Calendar = CALENDAR(MIN('Table1'[Contract start date]),MAX('Table1'[Contract end date]))
Then create a measure in fact table:
Amount = CALCULATE(SUM('Table1'[Contract amount]),FILTER('Table1','Table1'[Contract start date]<=MAX('Calendar'[Date]) && 'Table1'[Contract end date]>=MAX('Calendar'[Date])))
Please check attached .pbix file.
Best Regards,
Qiuyun Yu- bmrphNew Member
Is there anyway to group these by month?
- thugthugFrequent Visitor
i tried to make it a cumulative line, but unfortunately i messed it up.
Running Actuals = CALCULATE(SUM(Table1[Contract amount],FILTER(ALL(Table1[Contract start date],'Calendar'[Date].[Date]<=MAX('Calendar'[Date].[Date])))))
Is there any measure for this, but cumulative?
- Shelley
Post Prodigy
v-qiuyu-msft This is really helpful. Thank you! I plotted my contract values over time, but now is there a way to plot actual transactions as the run up to the total contract value, and then start over at the new contract? My formulas are giving me the blue and red line, but I want the blue and orange line.
BLUE Line:
Entitlement Amount =CALCULATE(SUM('Entitlements'[Entitlement Cap]),FILTER('QBContract','QBContract'[SAP Contract Start] <= MAX('RA_Daily_Calendar'[Date]) &&'QBContract'[SAP Contract End] >= MAX('RA_Daily_Calendar'[Date])))RED Line:List Price Amount =
CALCULATE(SUM('Transaction'[List_Price]),FILTER(ALLSELECTED('RA_Daily_Calendar'[CalendarYear-Mo]),ISONORAFTER('RA_Daily_Calendar'[CalendarYear-Mo], MAX('RA_Daily_Calendar'[CalendarYear-Mo]), DESC)))I also tried this, but this really didn't work:
Amount List Price =CALCULATE(SUM('Transaction'[List_Price]),FILTER('QBContract','QBContract'[SAP Contract Start] <= MAX('RA_Daily_Calendar'[Date]) &&'QBContract'[SAP Contract End] >= MAX('RA_Daily_Calendar'[Date])))Thanks for your help!