Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PraveenkarthikK
Frequent Visitor

Help needed on DAX to calculate distinct count with multiple conditions

Hello,

    I have a table with sales as shown below. This contains Country, product of sales along with from date and to date. as shown below

 

1IndiaTV1/1/20231/6/2023
2IndiaFridge1/1/20231/6/2023
3IndiaMonitor1/1/20231/6/2023
1AustraliaTV1/1/20231/6/2023
2AustraliaFridge1/1/20231/6/2023
3AustraliaMonitor1/1/20231/6/2023
1United KingdomTV1/1/20231/6/2023
2United KingdomFridge1/1/20231/6/2023
3United KingdomMonitor1/1/20231/6/2023

 

PraveenkarthikK_0-1685521292999.png

 

I have another table, where I need to count the number of items sold based on multiple conditions. I need to get a DAX column added to the second table to hold the count. I have tried DAX functions like Calculate + Filter. But it doesn't seem to work for me. It counts all rows irrespective of conditions.

 

I don't know what is wrong in this. Can some one please help me on this.

 

PraveenkarthikK_2-1685521866951.png

 

Thanks in Advance

1 REPLY 1
Ahmedx
Super User
Super User

you forgot to write ALL after FILTER

Count = CALCULATE(COUNT(Data[User]), FlLTER(ALL(Data),
Data[Country] = [Country] &&
Data[Product] = [Product] &&
Data[From Date]<= [Date] &&
Data[To Date]>=[Date]))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors