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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
OlegV
Helper III
Helper III

SUMMARIZECOLUMNS function when there is no relationship

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'.

OlegV_0-1715202545854.png

 

OlegV_2-1715202669235.png

 

but when there is no relationship, this fuction shows the total sum of OscarWins. Which is not want I need.

OlegV_1-1715202628544.png

What do I need to change in the DAX code, to get the result I need when there is no relationship?

3 REPLIES 3
ExcelMonke
Responsive Resident
Responsive Resident

Is there a particular reason why you don't want the relationship?

An alternative for you to consider is using the  LOOKUPVALUE function

@ExcelMonke 

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])

 

 

ExcelMonke
Responsive Resident
Responsive Resident

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. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.