Forum Discussion
Ravikjinfo
8 years agoFrequent Visitor
Display difference between bars in Line and Column Clustered Chart as Line
I am tring to create a Line and Column Clustered Chart as part of it. I have the Variable dates as X-AXIS (such as days in month or sundays in a year, last 13 weeks etc.. as dates). Y-AXIS has SalesA...
- 8 years ago
Hi Ravikjinfo,
Try the mesure below please. Please also check out the demo in the attachment.
Measure = VAR minimumDay = CALCULATE ( MIN ( 'Table1'[Date] ), ALL ( 'Table1' ) ) VAR lastday = CALCULATE ( MAX ( 'Table1'[Date] ), FILTER ( ALL ( 'Table1' ), 'Table1'[Date] < MIN ( 'Table1'[Date] ) ) ) VAR lastTotal = CALCULATE ( SUM ( 'Table1'[Value] ), FILTER ( ALL ( 'Table1' ), Table1[Date] = lastday ) ) RETURN IF ( MIN ( 'Table1'[Date] ) = minimumDay, 0, DIVIDE ( SUM ( Table1[Value] ) - lastTotal, lastTotal ) )Best Regards,
Dale
- 8 years ago
Thank you, It Worked.
v-jiascu-msft
8 years agoMicrosoft Employee
Hi Ravikjinfo,
Try the mesure below please. Please also check out the demo in the attachment.
Measure =
VAR minimumDay =
CALCULATE ( MIN ( 'Table1'[Date] ), ALL ( 'Table1' ) )
VAR lastday =
CALCULATE (
MAX ( 'Table1'[Date] ),
FILTER ( ALL ( 'Table1' ), 'Table1'[Date] < MIN ( 'Table1'[Date] ) )
)
VAR lastTotal =
CALCULATE (
SUM ( 'Table1'[Value] ),
FILTER ( ALL ( 'Table1' ), Table1[Date] = lastday )
)
RETURN
IF (
MIN ( 'Table1'[Date] ) = minimumDay,
0,
DIVIDE ( SUM ( Table1[Value] ) - lastTotal, lastTotal )
)
Best Regards,
Dale
Ravikjinfo
8 years agoFrequent Visitor
Thank you, It Worked.