Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a table as follows.
| Client_ID | ClientName | ClientProduct | Site | BilledAmount | ||||
| 1 | Client A | Product A | Site A | 2300 | ||||
| 1 | Client A | Product A | Site B | 2550 | ||||
| 1 | Client A | Product B | Site A | 2340 | ||||
| 2 | Client B | Product A | Site A | 2700 | ||||
| 2 | Client B | Product C | Site A | 3400 | ||||
| 3 | Client C | Product B | Site A | 4500 | ||||
| 4 | Client D | Product D | Site A | 3600 |
Different clients have products. These products could be on different or the same sites of the client. I would like to know.
1. How many clients have more than 1 ClientProduct?
2. How many clients have more than one 1 clientProduct in the same site ?
Just submit your answer if you can tackle any of them..
Thanks.
Solved! Go to Solution.
Hi @Anonymous
For first request try the measure :
For the second :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hey @Anonymous ,
you can create two calculated columns like so:
client has more than product =
var currentClientID = 'Table (2)'[Client_ID]
var noOfPrudcts =
CALCULATE(
DISTINCTCOUNT( 'Table (2)'[ClientProduct] )
, ALL( 'Table (2)' )
, 'Table (2)'[Client_ID] = currentClientID
)
return
IF( noOfPrudcts > 1 , "more than one product" , "only one product" )
and so:
spread across sites =
var currentClientID = 'Table (2)'[Client_ID]
var noOfSites =
CALCULATE(
DISTINCTCOUNT( 'Table (2)'[Site] )
, ALL( 'Table (2)' )
, 'Table (2)'[Client_ID] = currentClientID
)
return
IF( noOfSites > 1 , "more than one site" , "only one site" )
The table then will look like this:
I decided not to create a measure because I assume it's helpful if you can use these columns inside slicers.
Hopefully, this provides what you are looking for.
Hi,
You may download my PBI file from here.
Hope this helps.
Hey @Anonymous ,
you can create two calculated columns like so:
client has more than product =
var currentClientID = 'Table (2)'[Client_ID]
var noOfPrudcts =
CALCULATE(
DISTINCTCOUNT( 'Table (2)'[ClientProduct] )
, ALL( 'Table (2)' )
, 'Table (2)'[Client_ID] = currentClientID
)
return
IF( noOfPrudcts > 1 , "more than one product" , "only one product" )
and so:
spread across sites =
var currentClientID = 'Table (2)'[Client_ID]
var noOfSites =
CALCULATE(
DISTINCTCOUNT( 'Table (2)'[Site] )
, ALL( 'Table (2)' )
, 'Table (2)'[Client_ID] = currentClientID
)
return
IF( noOfSites > 1 , "more than one site" , "only one site" )
The table then will look like this:
I decided not to create a measure because I assume it's helpful if you can use these columns inside slicers.
Hopefully, this provides what you are looking for.
Hi @Anonymous
For first request try the measure :
For the second :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 25 |