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 a Clients table with client details
Clients Id | Name | DOB | Country |
1 | Uk | ||
2 | USA | ||
3 | UK |
and another products table
Product Id | Product Type | Client Id |
100 | P1 | 1 |
101 | P2 | 1 |
102 | P1 | 2 |
I want to get distinct country count by product type
Product Type | Count of distinct country |
P1 | 2 |
P2 | 1 |
How do I achieve that?
Solved! Go to Solution.
Hi @bml123 ,
Please check this measure.
Measure =
VAR ids =
CALCULATETABLE (
VALUES ( products[Client Id] ),
FILTER (
ALLSELECTED ( products ),
products[Product Type] = SELECTEDVALUE ( products[Product Type] )
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( Clients[Country] ),
FILTER ( ALLSELECTED ( Clients ), Clients[Clients Id] IN ids )
)
Best Regards,
Jay
Hi @bml123 ,
Please check this measure.
Measure =
VAR ids =
CALCULATETABLE (
VALUES ( products[Client Id] ),
FILTER (
ALLSELECTED ( products ),
products[Product Type] = SELECTEDVALUE ( products[Product Type] )
)
)
RETURN
CALCULATE (
DISTINCTCOUNT ( Clients[Country] ),
FILTER ( ALLSELECTED ( Clients ), Clients[Clients Id] IN ids )
)
Best Regards,
Jay
Hi @bml123
Try this
Distinct Country Count by Product Type = CALCULATE(DISTINCTCOUNT([Client Id]), FILTER('Data', 'Data'[Product Type] = SELECTEDVALUE('Data'[Product Type])))
regards
Phil
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
76 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
64 | |
59 | |
56 |