Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone,
I am new to Power BI and DAX. I have a table that has three columns, namely User_ID, Visit_ID, and Visit_Exposed. I want to :
1. Calculate the number of users (unique User_ID) who have at least one visit considered as exposed ;
2. Calculate the percentage of users who have at least one visit considered as exposed ( Users With At Least One Visit Considered As Exposed / All Users * 100 ).
In this situation, the number of users is the number of unique User_ID (one user = one User_ID), and the number of visits equals the number of unique Visit_ID (one visit = one Visit_ID).
Please let me know if I need to edit this post or post clarification.
Thank you for your help,
Kathia
Example
Solved! Go to Solution.
Hi @Anonymous,
Based on my test, you could refer to below measures:
Distinctcount = DISTINCTCOUNT(Table1[User_ID])
Percentage = DIVIDE(CALCULATE(COUNT(Table1[Visit_Exposed]),FILTER(ALL('Table1'),'Table1'[Visit_Exposed]<>0)),CALCULATE(DISTINCTCOUNT(Table1[Visit_ID]),ALL(Table1)))
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi @Anonymous,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He
Hi @Anonymous,
Based on my test, you could refer to below measures:
Distinctcount = DISTINCTCOUNT(Table1[User_ID])
Percentage = DIVIDE(CALCULATE(COUNT(Table1[Visit_Exposed]),FILTER(ALL('Table1'),'Table1'[Visit_Exposed]<>0)),CALCULATE(DISTINCTCOUNT(Table1[Visit_ID]),ALL(Table1)))
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
What you need to do is the following.
1. Create a measure with this DAX:
Number of users exposed = CALCULATE(DISTINCTCOUNT(Table1[user_id]);Table1[visit_exposed] = 1)
2. First create a new measure as the quantity of users:
Number of users = DISTINCTCOUNT(Table1[user_id])
Then, create a percentage measure as:
Percentage = DIVIDE([Number of users exposed]; [Number of users])
Last, mark the Percentage measure as Percentage in the Modeling tab.
Hope this helps.
Regards.
For part 1, you could filter the table to give you only rows that have exposed equal to 1.
Then put the distinct count of the user_id on a card.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |