Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good afternoon
I can never seem to get this right. I have a long listing of sales figures, where I am wanting to a CountIf on the the sales amounts that have an offset negative amount for the same customer
I hope the picture and that someone can assist
Thanking you
Stephen Daff
[Qty Offsets] = -- calculated column, not a measure var __customer = T[Customer Number] var __amount = T[Sales Amount] var __invNo = T[Invoice Number] var __qtyOffsetsForAmountNotZero = countrows( filter( T, T[Customer Number] = __customer, T[Sales Amount] = -__amount ) ) + 0 -- This is needed to force BLANK into 0 var __qtyOffsetsForAmountEquaToZero = countrows( filter( T, T[Customer Number] = __customer, T[Sales Amount] = 0, T[Invoice Number] <> __invNo ) ) + 0 var __qtyOffsets = if( __amount <> 0, __qtyOffsetsForAmountNotZero, __qtyOffsetsForAmountEquaToZero ) return __qtyOffsets -- Bear in mind that if the amount is 0 -- then we have to make sure that the -- invoice number is not equal to the -- current invoice number. This, of course, -- is not required if the amount <> 0.
Best
Darek
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
15 | |
10 |
User | Count |
---|---|
57 | |
50 | |
44 | |
21 | |
19 |