Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have 2 tables related by the Client id column. Table 'Client Table' & 'Status Change Table'.
I need a distinct count of Client id from the 'Client Table'.
I only want to distinct count the Client id under the following condition.
If the Status_ID or the Current_Status_ID columns in the 'Status Change Table' ever contain 5 then do not distinct count Client id in the 'Client Table'.
Desired result shown below.
Solved! Go to Solution.
Hi @Qotsa
Link to download the file: https://gofile.io/d/cVkADd
Try this code to add a column to your Client table:
Result =
VAR _Count =
COUNTROWS (
CALCULATETABLE (
EXCEPT (
VALUES ( Client[Client_ID] ),
SUMMARIZE (
FILTER (
'Status Change',
'Status Change'[Status_ID] = 5
|| 'Status Change'[Current_Status_ID] = 5
),
Client[Client_ID]
)
),
ALLEXCEPT ( Client, Client[Client_ID] )
)
)
RETURN
IF ( ISBLANK ( _Count ), 0, _Count )
Output:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your Kudos !!
Hi @Qotsa
Link to download the file: https://gofile.io/d/cVkADd
Try this code to add a column to your Client table:
Result =
VAR _Count =
COUNTROWS (
CALCULATETABLE (
EXCEPT (
VALUES ( Client[Client_ID] ),
SUMMARIZE (
FILTER (
'Status Change',
'Status Change'[Status_ID] = 5
|| 'Status Change'[Current_Status_ID] = 5
),
Client[Client_ID]
)
),
ALLEXCEPT ( Client, Client[Client_ID] )
)
)
RETURN
IF ( ISBLANK ( _Count ), 0, _Count )
Output:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your Kudos !!
Apologies. Previous PBIX incorrect.
Correct PBIX -> https://www.dropbox.com/s/h4fbc0m2gfg2b86/Client%20Status%20Change.pbix?dl=0
can you share sample data or a PBIX file (through Ondrive, Dropbox...)?
Do you need a measure or calculated column?
Proud to be a Super User!
Paul on Linkedin.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
96 | |
69 | |
45 | |
39 | |
30 |
User | Count |
---|---|
155 | |
96 | |
60 | |
42 | |
41 |