Forum Discussion
Force All Filter Context
- Anonymous1 year ago
If you want the static result not filtered by slicers/filters, the idea to create a calculated table to summarize the number in advance is doable. And this can improve the performance of measures because they can count easily from this new table.
But your table code is not correct. You could try below code instead.
Customers and LTV = Summarize('Table','Table'[CustomerID],"LTV",SUM('Table'[ProductTotal]),"NumOrders",DISTINCTCOUNT('Table'[OrderNumber]))Best Regards,
Jing
RyanNewportJP You can achieve this by using the ALL function to remove any filters applied to the Table in the CALCULATE function.
DAX
Repeat Customers =
COUNTROWS(
FILTER(
DISTINCT(Table[CustomerID]),
CALCULATE(
DISTINCTCOUNT(Table[OrderNumber]) > 1,
ALL(Table)
)
)
)
One-Time Customers =
COUNTROWS(
FILTER(
DISTINCT(Table[CustomerID]),
CALCULATE(
DISTINCTCOUNT(Table[OrderNumber]) = 1,
ALL(Table)
)
)
)
I tried that already and it didn't work, it's showing the same results with or without ALL(Table) added.
- bhanu_gautam1 year agoSuper User
RyanNewportJP , Try using remove filter than, Can you share sample data for testing
dax
Repeat Customers =
COUNTROWS(
FILTER(
DISTINCT(Table[CustomerID]),
CALCULATE(
DISTINCTCOUNT(Table[OrderNumber]) > 1,
REMOVEFILTERS(Table)
)
)
)One-Time Customers =
COUNTROWS(
FILTER(
DISTINCT(Table[CustomerID]),
CALCULATE(
DISTINCTCOUNT(Table[OrderNumber]) = 1,
REMOVEFILTERS(Table)
)
)
)- RyanNewportJP1 year agoFrequent Visitor
Sorry, I was looking at the wrong dashboard. It now isn't showing any orders as new and all as repeat:
I tried chaing one-time customrs's operator to ==, but nothing changed...