Forum Discussion
Visualization for contract start/end dates and cost
- 9 years ago
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
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
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?
- Shelley6 years agoPost 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!- Ashish_Mathur6 years agoSuper User
Hi,
Share some data and show the expected result in a simple table format.
- Shelley6 years agoPost Prodigy
Ashish_MathurI've tried three times now and powerbi community is not cooperating.
Please see image I posted previously. Here is an example of contract cap data.
BPID Customer Name (BPID) contr_num SAP Contract Start SAP Contract End Contract Cap 100769396399 ABC COMPANY (100769396399) 8003656409 2/1/2018 1/31/2019 $8,000 100769396399 ABC COMPANY (100769396399) 8004081579 2/1/2019 1/31/2020 $10,000 100769396399 ABC COMPANY (100769396399) 8004575589 2/1/2020 1/31/2021 $9,000