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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
JLMJ
New Member

dax expression to calculate % coming from 2 different tables

Hello!

I have a table of names on a product level

JLMJ_5-1682222312191.png

 

 

I need to populate this table. How do I put in dax the % TO TOTAL DISTINCT PER GRP 1?

Note: Names per GRP1 aren't unique. ex: Ruth and Jolo ordered both appetizer and mains but should only be counted as 2 for the denominator.

 

JLMJ_4-1682222278611.png

 

 

Thanks!

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @JLMJ 

not sure if i fully get you.

you may try to plot a table visual with necessary columns and two measures like:

#Names = DISTINCTCOUNT(data[name])
%PerGRP1 = 
VAR GrpCount =
CALCULATE(
    [#Names],
    data[GRP1] = MAX(data[GRP1]),
    ALL(data)
)
VAR Result = DIVIDE([#Names], GrpCount)
RETURN Result

it worked like:

FreemanZ_0-1682229411591.png

 

 

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @JLMJ 

not sure if i fully get you.

you may try to plot a table visual with necessary columns and two measures like:

#Names = DISTINCTCOUNT(data[name])
%PerGRP1 = 
VAR GrpCount =
CALCULATE(
    [#Names],
    data[GRP1] = MAX(data[GRP1]),
    ALL(data)
)
VAR Result = DIVIDE([#Names], GrpCount)
RETURN Result

it worked like:

FreemanZ_0-1682229411591.png

 

 

Hey it worked! Thanks a lot! 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.