The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello!
I have a table of names on a product level
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.
Thanks!
Solved! Go to Solution.
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:
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:
Hey it worked! Thanks a lot!
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |