Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have a dax code,
EVALUATE
SUMMARIZECOLUMNS (
ROLLUPADDISSUBTOTAL ( 'Genre'[Genre], "IfTotal" ),
TREATAS ( { "Western", "Musical", "Romance" }, 'Genre'[Genre] ),
"OscarWins", SUM('Film'[OscarWins])
)
ORDER BY 'Genre'[Genre] DESC
which correctly works when there is a relationship between tables 'Genre' and 'Film'.
but when there is no relationship, this fuction shows the total sum of OscarWins. Which is not want I need.
What do I need to change in the DAX code, to get the result I need when there is no relationship?
Is there a particular reason why you don't want the relationship?
An alternative for you to consider is using the LOOKUPVALUE function
Hi,
because it is a sample database. In my work there is no relationship between tables. I need a workaround.
Do I need to use a lookupvalue function like this?
Lookupvalue (sum('Film'[OscarWins], 'Film'[GenreId], 'Genre'[GenreId])
That looks right to me (Don't forget to add your closing parentheses for SUM 🤠). Of note, should your database be quite large, the Lookupvalue funciton may drag your overall dashboard performance a lot. However, based on what I can see, this shouldn't be too much of an issue.
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
111 | |
104 | |
85 | |
65 | |
63 |