Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
1 | India | TV | 1/1/2023 | 1/6/2023 |
2 | India | Fridge | 1/1/2023 | 1/6/2023 |
3 | India | Monitor | 1/1/2023 | 1/6/2023 |
1 | Australia | TV | 1/1/2023 | 1/6/2023 |
2 | Australia | Fridge | 1/1/2023 | 1/6/2023 |
3 | Australia | Monitor | 1/1/2023 | 1/6/2023 |
1 | United Kingdom | TV | 1/1/2023 | 1/6/2023 |
2 | United Kingdom | Fridge | 1/1/2023 | 1/6/2023 |
3 | United Kingdom | Monitor | 1/1/2023 | 1/6/2023 |
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.
Thanks in Advance
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]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |