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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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