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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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?

1 ACCEPTED SOLUTION
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. 

View solution in original post

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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