I'm trying to create a calculated column to see how many price variations appear on a match exception report for a voucher. I can then filter on all voucher exceptions where the Invoice Price Mix > 1.
Invoice 123 has 3 different price variations - Higher, Same, and Lower. Invoice 456 has 2 variations - Lower, Same
But what i thought would be a simple calculated column is tying me in knots. The following DAX returns 3 for every row.
What on earth am i missing for something so simple? Vchr Price Direction is also a calculated column - would that matter?
Invoice 123 has 3 different price variations - Higher, Same, and Lower. Invoice 456 has 2 variations - Lower, Same
Invoice | Line | PO Price | Voucher Price | Vchr Price Direction |
123 | 1 | 1 | 2 | Higher |
123 | 2 | 2 | 2 | Same |
123 | 5 | 3 | 2 | Lower |
456 | 1 | 5 | 4 | Lower |
456 | 2 | 5 | 5 | Same |
But what i thought would be a simple calculated column is tying me in knots. The following DAX returns 3 for every row.
Code:
[Invoice Price Mix] =
VAR MyInvoice = 'Match Exception'[Invoice]
VAR PriceSwings =
FILTER (
VALUES ( 'Match Exception'[Vchr Price Direction] ),
'Match Exception'[Invoice] = MyInvoice
)
RETURN
COUNTROWS ( PriceSwings )
What on earth am i missing for something so simple? Vchr Price Direction is also a calculated column - would that matter?