Forum Discussion
KPI Percentage difference - discard empty values
- 1 year ago
Hi tonijj
Question 1:
try this measure
KPI_PercentageDifference (%) := AVERAGEX( FILTER( Products, Products[WalmartPrice] > 0 && Products[PublixPrice] > 0 ), ABS(Products[WalmartPrice] - Products[PublixPrice]) / DIVIDE((Products[WalmartPrice] + Products[PublixPrice]), 2) ) * 100You could also do this in power query, setting up a calculated column to show 'true' if both values are present, 'false' if one is missing, then filter false
= if [WalmartPrice] = null or [PublixPrice] = null or [WalmartPrice] = 0 or [PublixPrice] = 0 then true else falseQuestion 2:
Power query is the easiest place to replace values, select 'transform data', go to the table you need, right click the column and select 'replace values'.
If this helps please give a thumbs up and mark as the solution, thanks.
Hi tonijj
Question 1:
try this measure
KPI_PercentageDifference (%) :=
AVERAGEX(
FILTER(
Products,
Products[WalmartPrice] > 0 &&
Products[PublixPrice] > 0
),
ABS(Products[WalmartPrice] - Products[PublixPrice]) /
DIVIDE((Products[WalmartPrice] + Products[PublixPrice]), 2)
) * 100
You could also do this in power query, setting up a calculated column to show 'true' if both values are present, 'false' if one is missing, then filter false
= if [WalmartPrice] = null or [PublixPrice] = null or [WalmartPrice] = 0 or [PublixPrice] = 0 then true else false
Question 2:
Power query is the easiest place to replace values, select 'transform data', go to the table you need, right click the column and select 'replace values'.
If this helps please give a thumbs up and mark as the solution, thanks.