Forum Discussion

Auski's avatar
Auski
Advocate I
2 years ago
Solved

DAX calculation based on 2 text values in same column

Hi guys,
 
I feel like this one might be an easy one, but for some reason I can't get it.

Working Dax 1:
Abandoned = SUM('Inbound Queues'[Abandon])

Working Dax 2
Total Abandoned = CALCULATE(
    [Abandoned],
    FILTER(ALL('Inbound Queues'[queue_name]),
            'Inbound Queues'[queue_name]= "FS - FC Queue"
    )
)

The above DAX works great for what I need however I really need to add a second queue "FS - MQ Queue" so that they both return a combined value for any filtered date. I feel that curly brackets come into it somehow, but not quite getting it.
 

Interval_Startqueue_namemediatypeAbandon
13/11/2023 0:00FS - FC Queuevoice0
13/11/2023 0:00FS - MQ Queuevoice5
12/11/2023 0:00FS - FC Queuevoice0
12/11/2023 0:00FS - MQ Queuevoice11
11/11/2023 0:00FS - FC Queuevoice0
11/11/2023 0:00FS - MQ Queuevoice4
10/11/2023 0:00FS - FC Queuevoice2
10/11/2023 0:00FS - MQ Queuevoice0
9/11/2023 0:00FS - FC Queuevoice0
9/11/2023 0:00FS - MQ Queuevoice3
8/11/2023 0:00FS - FC Queuevoice0
8/11/2023 0:00FS - MQ Queuevoice0
7/11/2023 0:00FS - FC Queuevoice1
7/11/2023 0:00FS - MQ Queuevoice5
6/11/2023 0:00FS - FC Queuevoice0
6/11/2023 0:00FS - MQ Queuevoice2
5/11/2023 0:00FS - FC Queuevoice1

Date filtered 13/11/2023 should return 5 abandons.

Hope this makes sense. It is getting late and my head is so scrabbled.

Thanks!
  • in theory this should work but haven't tested it

     

    Total Abandoned =
    CALCULATE (
    [Abandoned],
    FILTER (
    ALL ( 'Inbound Queues'[queue_name] ),
    'Inbound Queues'[queue_name] IN { "FS - FC Queue", "MQ - FC Queue" }
    )
    )

2 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    in theory this should work but haven't tested it

     

    Total Abandoned =
    CALCULATE (
    [Abandoned],
    FILTER (
    ALL ( 'Inbound Queues'[queue_name] ),
    'Inbound Queues'[queue_name] IN { "FS - FC Queue", "MQ - FC Queue" }
    )
    )

    • Auski's avatar
      Auski
      Advocate I

      Thanks so much vanessafvg! This works perfectly 😁