1

I currently have some columns in a power Query Table:

Client Quantity & Quantity Delivered.

I want to have a table which count "1" When Client Quantity are equal to Quantity Delivered and 0 in the contrary.

I tried this:

 [`Client Quantity`]=`Quantity delivered`],
    1,
        0
    )

Which works, but some Client Quantity and Quantity delivered are empty and power bi counts it like a 0.

I only want to keep real data

I tried this:

    Livraisons blanches = 
 IF(
         [Client Quantity]=[Quantity Delivered]
                    1,
                    IF(
                        [Client Quantity]= BLANK(),
                        BLANK,
                            IF(
                                [Quantity Delivered]=BLANK(),
                                BLANK(),
                                2
                            )
                    )
 )

But it's not currently working.

Can I regroup both Client Quantity and Client Delivered to exclude them from the count?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
YannP
  • 25
  • 7

1 Answers1

3

You could write it like this:

Livraisons blanches =
IF (
    ISBLANK ( [Client Quantity] ) || ISBLANK ( [Quantity Delivered] ),
    BLANK (),
    IF ( [Client Quantity] = [Quantity Delivered], 1, 0 )
)
Alexis Olson
  • 38,724
  • 7
  • 42
  • 64
  • Thank you by a lot its working By any chance do you know why the counter isnt working? It stay at 0 despite multiples "1" – YannP Oct 21 '21 at 15:37
  • I don't know what "counter" you're referring to. – Alexis Olson Oct 21 '21 at 15:39
  • the total in table bottom (the sum currently) – YannP Oct 21 '21 at 15:41
  • The table total isn't summing up the individual rows but rather calculating the measure just like each of the individual rows does. Since there's a quantity mismatch, it returns 0. – Alexis Olson Oct 21 '21 at 15:45
  • Ok thank for the answer, is there a way to calculate the total? – YannP Oct 21 '21 at 15:46
  • Yes, but that's a separate question. See [here](https://stackoverflow.com/questions/65515750) and [here](https://stackoverflow.com/questions/52953022) for similar questions. – Alexis Olson Oct 21 '21 at 15:55
  • I will look into it and post a separate question if i don't find any result. – YannP Oct 21 '21 at 16:01