Forum Discussion

WillianRamos's avatar
WillianRamos
Frequent Visitor
3 years ago

Problem with Percentage when comparing 2 year billing amounts

Hello, I need to compare the billing value of 2 years dynamically. for this I created 2 calendar tables and related them to the Invoice fact table and created the measures as shown below.


Base Year = CALCULATE(SUM('Invoices'[total]), ALL('dCalendarComparative'))

Compare Year = CALCULATE(SUM('Invoices'[total]), ALL('dCalendarBase'))


then I placed the year fields in the upper left part of the dashboard as shown in the image below and used parameters to filter by year, month or quarter.

these parameters look for information from the Invoices fact table, because that's where the general information is.

 

Param Chart = {
("Year", NAMEOF(Invoices[Year]), 0),
("Month", NAMEOF('Invoices'[MonthName]), 1),
("Quarter", NAMEOF('Invoices'[QuarterName]), 2)
}


in the first graph I just need the information of the values and it is returning me correctly. but in the bottom graph where I need the percentage it keeps returning me -100% and with all years. I need help to fix this.

 

the correct value is 36% as I put it on a card at the top.

 

% Measure = CALCULATE(DIVIDE([Compare Year], [Base Year]))-1