Forum Discussion
Measurements with filter from a different tables
- Anonymous1 year ago
Hi SteenSoernesen ,
Instead, you can use LOOKUPVALUE() in your measure to determine if the station is a measuring point (Maalepunkt = TRUE). For example -Canceled_Events :=
CALCULATE(
COUNTROWS(Fact_Events),
Fact_Events[Status] = "aflyst",
LOOKUPVALUE(
Dim_Stationer[Maalepunkt],
Dim_Stationer[TogNr], Fact_Events[TogNr],
Dim_Stationer[Stop navn], Fact_Events[Stop navn]
) = TRUE()
)This formula matches the train number and station name from the fact table to the dimension table, filtering for rows where Maalepunkt is true. You can apply this approach to other statuses such as forsinket, planmaessig, and others.
It sounds like you're trying to perform a measurement that involves information from multiple tables – a scenario where the data model structure is critical.
From what you’ve described, it’s possible that your data model isn’t following a proper star schema – meaning a fact table (like Fact_Events) that connects via clear relationships to multiple dimension tables (like Dim_Stationer).
When there’s no direct relationship between the tables, Power BI may not propagate filters as expected.
So it’s important to make sure there’s a relationship (e.g., via Station ID) between Fact_Events and Dim_Stationer, and that the model allows for proper filter flow.
More information abput star scheema here :
https://www.phdata.io/blog/data-modeling-fundamentals-in-power-bi/
To provide more targeted help, I recommend sharing your PBIX file (or a simplified version) via a public cloud service like Google Drive, Dropbox, OneDrive, etc.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly