Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey there, I came across a problem which I'm not sure how to solve.
I've 4 Columns i.e., Internet, Phone, TV & CustomerID. In first 3 columns, if a user has opted for it then it's a "yes" else it says "no".
Now, I want to count the total number of services a user has opted for.
I'm new to BI & I thought that maybe I'll get some help here.
Solved! Go to Solution.
Hi,
Here is one way to do this:
Data:
Dax:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
This data model is not what PBI likes. Unpivot the 3 columns, so that your table looks like this:
CustomerID | Service | Value
--------------------------------
1 | TV | Yes
1 | Phone | No
1 | Internet | Yes
2 | TV | Yes
2 | Phone | No
....
Once you've got it, then it's dead easy (if you put the CustomerID on rows in a table/matrix visual):
[# Services Opted For] =
calculate(
// You have to decide how you want to
// calculate this statistic when many
// CustomerID's are visible in the
// current context. Here I calculate
// the number of different services
// that at least one customer in the
// current context has opted for.
distinctcount( T[Service] ),
keepfilters( T[Value] = "yes" )
)
Hi,
Here is one way to do this:
Data:
Dax:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |