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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.