Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 @Anonymous
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 @Anonymous
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,
Hello @Anonymous
You would just change it to:
Users = DISTINCTCOUNT( mockup[User] )
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
56 | |
38 | |
35 |
User | Count |
---|---|
85 | |
66 | |
59 | |
46 | |
45 |