Reply
SophieM
New Member

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
1 ACCEPTED SOLUTION
Cookistador
Continued Contributor
Continued Contributor

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 

View solution in original post

3 REPLIES 3
SophieM
New Member

thank you very much

Cookistador
Continued Contributor
Continued Contributor

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 🙂 

Cookistador
Continued Contributor
Continued Contributor

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 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)