Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
data_insights
Microsoft Employee
Microsoft Employee

Calculate percentages dynamically when filters are applied

I have two tables, I want to calculate percentage users using NumUsers from Table 1 and Totalusers from Table 2. 

 

I want to show , Percentage users who performed an action based on the Platform and usertype combination . Platform and UserType will be slicers and the percentage has to change based on filters applied.

 

Example : Percentage of Users who clicked on "Subscribe" should be 10/10 (NumUsers from row 1 of table 1)/ (Chrome Paid TotalUsers) instead of 10/100 (Numusers from row1 of table1/ Totalusers across all platforms and usertypes).

 

I tried merging the platform and usertype columns to create a relationship between the two tables but that did not work as expected.

Table 1: UserActions

 

ActionPlatformUserTypeNumUsers
SubscribeChromePaid10
SubscribeEdgeFree5
Click  HelpEdgePaid6
Click  HelpChromeFree5
Click  HelpFireFoxFree4
Click  HelpFireFoxPaid4
Search EdgeFree4
Search EdgePaid6
Search ChromeFree10

 

Table 2: Total Users

PlatformUserTypeTotalUsers
ChromePaid10
ChromeFree20
EdgePaid20
EdgeFree15
FireFoxPaid15
FireFoxFree 20

 

Any help is appreciated.

1 REPLY 1
DataInsights
Super User
Super User

@data_insights, see the data model below:

 

DataInsights_0-1599341898023.png

 

Create measure:

 

% Users = 
VAR vNumUsers = SUM ( UserActions[NumUsers] )
VAR vTotalUsers = SUM ( TotalUsers[TotalUsers] )
RETURN
DIVIDE ( vNumUsers, vTotalUsers )

 

Result:

 

DataInsights_1-1599341922934.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.