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.
Hi All,
I am trying to change the value of a alculated coulmn based on filtere selection.
I have the following table with columns ( software, user, region ) and have created the total unique number of user that uses a software.
I have done it two seperate ways so far:
1) a calculated column :
column = CALCULATE(DISTINCTCOUNT(mockup[User]),ALLexcept(mockup,mockup[software]))
2) a calculated table :
Table =SUMMARIZE(mockup,mockup[software],"distinct users",CALCULATE(DISTINCTCOUNT(mockup[user])))
which works well:
but if I want to add a slicer based on region the values do not change. I would like to to see this when US is selected on the slicer:
Ansys 1 ------ (only user A)
Coreo 2 ------ (user A+D)
Microsoft 2 ------ (user A+D)
Can anyone help to fix this?
Thank you
Solved! Go to Solution.
Hello @merinadica
It seems like just a simple measure would do what you want.
Users = DISTINCTCOUNT( software[User] )
It respects whatever filter flows into the measure (row, column, slicer, etc).
I'm not sure what extra steps you're taking here.
You literally create a new measure with this expression and put it into the table with the software
UserCount = DISTINCTCOUNT(mockup[user])
You don't even need to use a measure for something this simple. You can drag User into the values, click the down arrow, and select Count(distinct).
Here's a .pbix with the data you gave and a table with 2 ways of counting users: https://drive.google.com/open?id=15Hxkc2p0D82A7S_t7MOjI2tOn40kGbgK
Hello @merinadica
It seems like just a simple measure would do what you want.
Users = DISTINCTCOUNT( software[User] )
It respects whatever filter flows into the measure (row, column, slicer, etc).
Thank you for taking your time to reply to my post.
I was not able to replicate your formula can you explain more on how to apply it?
just to be more accurate, my table name is "mockup" with three columns with names "software","user" and "region" . in your formula I see that "user" is a column of table "software". could you please calify more ?
Thank you,
This is what I get when US is filtered:
and the table with no filter applied :
I
I am not sure what I am missing here.
I'm not sure what extra steps you're taking here.
You literally create a new measure with this expression and put it into the table with the software
UserCount = DISTINCTCOUNT(mockup[user])
You don't even need to use a measure for something this simple. You can drag User into the values, click the down arrow, and select Count(distinct).
Here's a .pbix with the data you gave and a table with 2 ways of counting users: https://drive.google.com/open?id=15Hxkc2p0D82A7S_t7MOjI2tOn40kGbgK
Don't add my formula as a calculated column, add it as a measure.
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 |
---|---|
106 | |
94 | |
76 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |