Forum Discussion
Filtercontext with date relation
- 1 month ago
Hey, s_schultes ,
Your flag won't be filtered by department, and will send the result to every single department you have. This probably causes the overhelm of Direct Query.
Same also for customers that don't have a revenue or something:
You don't even need the flag. You can just build something like this, which will automatically not display anybody that doesn't have revenue or w/e you're after.
Neukunden Netto = CALCULATE( SUM(FactSales[geknetto]), USERELATIONSHIP( DimDate[Date], DimKunde[Anlagedatum] ) )
If you need to display customers by department, you can also do sometheing like this:Neukunde Flag Updated = CALCULATE( COUNTROWS(DimKunde), USERELATIONSHIP( DimDate[Date], DimKunde[Anlagedatum] ), TREATAS( VALUES(FactSales[KundeId]), DimKunde[Id]) )
Neukunden Gesamtnetto =
VAR IsNewCustomer =
CALCULATE(
COUNTROWS(DimKunde),
USERELATIONSHIP(DimDate[Date], DimKunde[Anlagedatum])
)
RETURN
IF(
IsNewCustomer > 0,
[Gesamtnetto],
BLANK()
)
Parchitect Hi, i will try it with the second dateTable.
But how should the relation work now?
I have DimDateKunde and DateKunde with a active Relation but if I make a relation with FactSales, this will be a inactive relationship. How should I handle this relation then?
- v-achippa1 month agoCommunity Support
Hi s_schultes,
Thank you for reaching out to Microsoft Fabric Community.
Here you don't need to connect the new date table to FactSales, just create an active relationship between DimDateKunde → DimKunde[Anlagedatum].
- DimDateKunde filters DimKunde by the customer creation date and your existing DimKunde → FactSales relationship carries that filter through to the sales table. Use DimDateKunde as the slicer for the new customer period and DimDate as the slicer for the sales period, this gives you two separate active date tables.
Thanks and regards,
Anjan Kumar Chippa