Forum Discussion

SophieM's avatar
SophieM
New Member
1 year ago
Solved

Combining 2 Dax formulas

Hello,

 

I just start recently to learn by myself Power BI. 

I want to combine Countrows with Contains but it is not functioning.

Could you please tell me what i do wrong here?

Available Veh = COUNTROWS(FILTER(Tabel1, Tabel1[Type] in {chokolate, caramel, vanilla})); Contains(Tabel2(Available Stock; "true"))

 

 

DateAvailable StockCustomer Orders
01.03.20252512
02.03.20252010
03.03.20253020
04.03.20252217
  • Hello,

    First, your IN function is not correct, the right synatx is: IN {"chokolate","Caramel","Vanilla"}

    For your dax function, this one should work

     

    CALCULATE(
    COUNTROWS(Tabel1),
    Tabel1[Type] IN {"chocolate", "caramel", "vanilla"},
    FILTER(Tabel2, Tabel2[Available Stock] = "true")
    )

     

    Do not hesitate to ask if it is not working or share a sample of your dataset 

3 Replies

  • Hello,

    First, your IN function is not correct, the right synatx is: IN {"chokolate","Caramel","Vanilla"}

    For your dax function, this one should work

     

    CALCULATE(
    COUNTROWS(Tabel1),
    Tabel1[Type] IN {"chocolate", "caramel", "vanilla"},
    FILTER(Tabel2, Tabel2[Available Stock] = "true")
    )

     

    Do not hesitate to ask if it is not working or share a sample of your dataset 

    • Cookistador's avatar
      Cookistador
      Icon for Super User rankSuper User

      If your issue is solved, do not hesistate to mark my post as a solution!

      If not, do not hesistate to ask me for more help 🙂