Forum Discussion
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")) |
| Date | Available Stock | Customer Orders |
| 01.03.2025 | 25 | 12 |
| 02.03.2025 | 20 | 10 |
| 03.03.2025 | 30 | 20 |
| 04.03.2025 | 22 | 17 |
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
- Cookistador
Super User
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
- SophieMNew Member
thank you very much
- Cookistador
Super 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 🙂