related()
2 TopicsUnexpected behavior of calculated column
Hi community, we have a simple data model with tables order, order item and item. For statistical purposes we want to have the quantity sold for the item. If I add calculated column to article it works. If I then filter the visual by date from the order, that column is not filtered. Could anyone help to fix the problem, please? DAX: Verkaufte Menge = SUMX(RELATEDTABLE(tAuftragPosition), tAuftragPosition[fAnzahl]) Bye MagnusSolved550Views0likes2CommentsBypassing the RELATED() function for inactive relationships
I need help with part of my model. Part of my model looks like this (the identical column names are the ones related to each other): My problem is that there are Raw Data entries that don't have an Order ID, but are still important in the visuals, which get filtered out when I use "Line Names" as a Slicer filter in my visualization, beacuse of the current active relationships. I can solve this by switching the active relationship from Lines-to-Orders to Lines-to-Raw Data. Unfortunately, my calculated column in the Orders table relies on this current active relationship and looks like this: Max Order Speed (cases/min) = MIN( MIN( DIVIDE( VALUE(RELATED(Lines[Max Speed Filler (pcs/min)])), Orders[Products per Case], 0 ), VALUE(RELATED(Lines[Max Speed Packer/Palletizer (cases/min)])) ), DIVIDE( VALUE(RELATED(Lines[Max Speed MPU (t/h)])) * 1000, // convert t/h to kg/h RELATED(Products[Product Weigth]) * Orders[Products per Case] * 60, // convert to cases/min 0 ) ) When I change the active relationships, my RELATED() functions can't refer to the Lines table anymore. I'd like to change my DAX expression to bypass this function, so my calculated column stays active when I change the active relationships. I think that's easier than to keep the relationships as is and in some way managing to not filtering out the raw data that doesn't have an Order ID... I tried asking ChatGPT for help, but it just keeps trying adding in CALCULATE, USERELATIONSHIP, SUMX, FILTER (which requires me from switching from a calculated column to a measure), but without avail. Any recommendations?2.4KViews0likes3Comments