Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi everyone, I’d appreciate your help. I’m trying to use a filter with the RELATED function inside CALCULATE, something like:
CALCULATE(COUNTDISTINCT(Id), Sales[Date] < RELATED(Orders[ExpirationDate])).
I get an error saying that the column used in RELATED doesn’t exist. I know a row context is needed, but in this case I want to avoid using FILTER to filter a whole table.
Solved! Go to Solution.
CALCULATE(
COUNTDISTINCT(Id),
Filter(
Summarize(
Orders,
Sales[Date],
Orders[ExpirationDate]
),
Sales[Date] < Orders[ExpirationDate]
)
)
Hi @ramiro_gonzalez,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like you are facing issue in your DAX. As @Deku and @bhanu_gautam both responded to query, please go through the responses and mark the helpful reply as solution.
I would also take a moment to thank @Deku and @bhanu_gautam, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Community Support Team
If this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
CALCULATE(
COUNTDISTINCT(Id),
Filter(
Summarize(
Orders,
Sales[Date],
Orders[ExpirationDate]
),
Sales[Date] < Orders[ExpirationDate]
)
)
@ramiro_gonzalez , Use
DAX
CALCULATE(
COUNTDISTINCT(Sales[Id]),
TREATAS(
VALUES(Sales[Date]),
Orders[ExpirationDate]
)
)
Proud to be a Super User! |
|