Forum Discussion
How does Null Handling work in USERELATIONSHIP and TREATAS
Hi gitgithan ,
Your understanding of the relationship evaluation as many (Sales) to one (Date) is correct. The function activates an inactive relationship for the calculation context. When nulls are present and you're summing based on them, the DAX engine creates a separate empty row to aggregate these values for those records that cannot be sorted by the sort field. Most of the time, we need to plan wisely during the modeling phase to avoid this.
Understanding blank row and limited relationships - SQLBI
Looking at the second formula, it deactivates/removes the relationship before 'Date'[DateKey], 'Sales'[OrderDateKey] from the calculation and then uses TREATAS to pass the filter on 'Date'[DateKey] to 'Ship Date'[ShipDateKey].
It's like this:
As for why the empty rows disappeared, my guess is that at this point none of the keys in the fact table are empty and can be found in the dim table.
Propagating filters using TREATAS in DAX - SQLBI
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group