Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey all,
I need help displaying something correctly in my matrix visual. I have two tables--
1) Users Tbl
2) Domains Tbl
I need to display a matrix visual like the following:
User | Domain Count | Top Domain |
some user | 25 | google.com |
another user | 15 | yahoo.com |
TOTAL | 40 | google.com |
By default, the matrix visual displays the first or last domain. Can anyone help me create a measure that will output the Domain based on the Domain Count? The total should reflect the entire dataset irrespective of user, but by row it should show the top domain by user. Hope that makes sense!
Any help is appreciated.
Solved! Go to Solution.
Your measure is missing a CALCULATE for the COUNT expression in the variables vUserDomain and vAllDomain. Alternatively, you can use a measure, resulting in an implicit CALCULATE. The correct measures are below:
Domain Count = COUNT ( Domains[Domain] )
Top Domain =
VAR vUser =
MAX ( Users[UserId] )
VAR vUserDomain =
ADDCOLUMNS (
SUMMARIZE ( Domains, Domains[UserId], Domains[Domain] ),
"DomainCount", [Domain Count]
)
VAR vUserDomainRank =
ADDCOLUMNS (
vUserDomain,
"DomainRank", RANKX ( vUserDomain, [DomainCount],, DESC, DENSE )
)
VAR vUserTopDomainRow =
FILTER ( vUserDomainRank, [DomainRank] = 1 )
VAR vUserTopDomain =
MAXX ( vUserTopDomainRow, Domains[Domain] )
VAR vAllDomain =
ADDCOLUMNS (
SUMMARIZE ( Domains, Domains[Domain] ),
"DomainCount", [Domain Count]
)
VAR vAllDomainRank =
ADDCOLUMNS (
vAllDomain,
"DomainRank", RANKX ( vAllDomain, [DomainCount],, DESC, DENSE )
)
VAR vAllTopDomainRow =
FILTER ( vAllDomainRank, [DomainRank] = 1 )
VAR vAllTopDomain =
MAXX ( vAllTopDomainRow, Domains[Domain] )
RETURN
IF ( HASONEVALUE ( Users[UserName] ), vUserTopDomain, vAllTopDomain )
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |