The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have 2 tables:
"planned visits" and "visited"
PLANNED VISITS:
ID | Quarter | SALES REP |
1 | Q1 | John |
2 | Q1 | John |
3 | Q1 | John |
1 | Q2 | John |
4 | Q1 | Rob |
6 | Q1 | Rob |
VISITED:
ID | Quarter | SALES REP |
1 | Q1 | John |
2 | Q1 | John |
4 | Q1 | Rob |
I have 2 measures that count how many clients each sales rep has per quarter:
ID | Quarter | SALES REP |
1 | Q1 | John |
2 | Q1 | John |
4 | Q1 | Rob |
99999 | Q1 | John |
Solved! Go to Solution.
Hi @df123445 ,
Looking at the documentation of the CALCULATE function, you can see that you can add multiple filters (your GROUPBY is the first and only filter you apply).
CALCULATE(<expression>[, <filter1> [, <filter2> [, …]]])
This means, you can simply add a comma and add another filter to only look at ID's available in your other table. Something like:
CALCULATE(
DISTINCTCOUNT('VISITED'[ID]),
GROUPBY('VISITED', 'VISITED'[Quarter], 'VISITED'[SALES REP] ),
'VISITED'[ID] IN VALUES('PLANNED'[ID])
)
now you added anothter filter.
Hi @df123445 ,
Looking at the documentation of the CALCULATE function, you can see that you can add multiple filters (your GROUPBY is the first and only filter you apply).
CALCULATE(<expression>[, <filter1> [, <filter2> [, …]]])
This means, you can simply add a comma and add another filter to only look at ID's available in your other table. Something like:
CALCULATE(
DISTINCTCOUNT('VISITED'[ID]),
GROUPBY('VISITED', 'VISITED'[Quarter], 'VISITED'[SALES REP] ),
'VISITED'[ID] IN VALUES('PLANNED'[ID])
)
now you added anothter filter.