Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Table1 | ||
aptid | date | programcode |
1 | 1/1/2023 | a |
2 | 1/2/2023 | a |
3 | 1/3/2023 | a |
4 | 1/4/2023 | b |
5 | 1/5/2023 | b |
6 | 1/6/2023 | b |
7 | 1/7/2023 | b |
8 | 1/8/2023 | c |
9 | 1/9/2023 | c |
10 | 1/10/2023 | c |
========================
Table2 | ||
aptid | date | assigned to |
1 | 1/1/2023 | t1 |
2 | 1/2/2023 | t2 |
3 | 1/3/2023 | t3 |
4 | 1/4/2023 | t4 |
5 | 1/5/2023 | t5 |
Above are the 2 tables example I have and the relationship is on Aptid and it is one to one and filtering is in both direction.
Now when I calculte the count of the aptids of Table1 it come out to be 5 and not 10 . how can I avaoid Table2 filtering the table 1 rows ? i am using below query :
It seems like you want to calculate the count of rows in Table1 that meet certain criteria (date and programcode) without considering any filtering from Table2. To achieve this, you should use the ALL function in DAX to remove any filters applied by Table2. Here's how you can modify your DAX formula:
CALCULATE(
COUNT('Table1'[AppointmentID]),
FILTER(
ALL('Table1'),
'Table1'[date] >= DATE(2023, 6, 1)
&& ('Table1'[programcode] = "a" || 'Table1'[programcode] = "b")
)
)
In this modified formula:
This should give you the count of rows in Table1 that meet your specified criteria without being affected by filters from Table2.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |