Lukeos93
Lukeos93

Reputation: 37

Why don't I see my growth on the last year for each row on PowerBi?

I have put on the dashboard of Power Bi a matrix with years on columns, district areas on rows and total actual revenue, absolute growth and percentage growth on the last year as values. Why don't I see the absolute growth for each district? I'm using also years as parameter

M-CY_Sales = CALCULATE(sum('Detail Sales Report'[Total Actual Revenue - Base]);filter('Detail Sales Report';'Detail Sales Report'[fiscal Year]=CurrentYear[CurrentYearValue]))

M-PY_Sales = CALCULATE(sum('Detail Sales Report'[Total Actual Revenue - Base]);filter('Detail Sales Report';'Detail Sales Report'[fiscal Year]=CurrentYear[CurrentYearValue]-1))

M-PY2_Sales = CALCULATE(sum('Detail Sales Report'[Total Actual Revenue - Base]);filter('Detail Sales Report';'Detail Sales Report'[fiscal Year]=CurrentYear[CurrentYearValue]-2))

M-PY_Growth = calculate([M-PY_Sales]-[M-PY2_Sales];'Detail Sales Report')

M-PY_Growth% = DIVIDE([M-PY_Growth];ABS([M-PY2_Sales]))

M-CY_Growth = [M-CY_Sales]-[M-PY_Sales]

M-CY_Growth% = DIVIDE([M-CY_Growth];ABS([M-PY_Sales]))

Upvotes: 0

Views: 33

Answers (1)

BarneyL
BarneyL

Reputation: 1362

I believe the issue is here:

M-PY_Growth = calculate([M-PY_Sales]-[M-PY2_Sales];'Detail Sales Report')

Using calculate in this form has an implicit inclusion of the ALL() function around the filter term which will strip out the context of the rows the measure sits within. To override this try:

M-PY_Growth = calculate([M-PY_Sales]-[M-PY2_Sales];KEEPFILTERS('Detail Sales Report'))

If that doesn't work you may need to experiment with ALLEXCEPT() to selectively keep district as a filter but allow the year context to be adjusted.

Upvotes: 1

Related Questions