Forum Discussion
StephenK
5 years agoResolver I
Matrix Visual Display Top Domain by Count
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 Doma...
- 5 years ago
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 )
Anonymous
5 years agoNot applicable
Hi StephenK ,
Could you please provide some sample data of table Users and Domains and your desired result with examples? Whether exist any relationship between these two tables? If yes, could you please also provide the relationship field? By the way, Domain Count is the number of users grouped by domain? User field display the specific user name?
Best Regards
Rena
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.