Forum Discussion
Exclude values from Average calculation
- 4 years ago
You're right. This worked for me, then:
SalesFiltered =
VAR _Exclude =
CALCULATE (
SUM(dailyKPI[Sales]),
KEEPFILTERS ( dailyKPI[Warehouse] = "60"),
KEEPFILTERS ( dailyKPI[Month - Year] IN {"September 2020","October 2020", "November 2020", "December 2020", "August 2021","September 2021","October 2021"} )
)
RETURN
SUM(dailyKPI[Sales]) - _Exclude--NOTE: if possible, apply the filters to the dimension table (not the fact table)
Is this a specific, non-repeating scenario?
If so, you may add to CALCULATE the modifier KEEPFILTERS:
=CALCULATE(
{Formula},
KEEPFILTERS(NOT(AND('Sales'[Department]="Department X", 'Calendar'[Year-Month] IN {2021-02,2021-03})
)
- Nanakwame4 years ago
Helper II
Hi
I tried this measure and it didnt work. I get an error.
SalesFiltered = CALCULATE(SUM(dailyKPI[Sales]),KEEPFILTERS(NOT(AND(dailyKPI[Warehouse] = "60", dailyKPI[Month - Year] IN {"September 2020","October 2020", "November 2020", "December 2020", "August 2021","September 2021","October 2021"}))))- rbriga4 years ago
Impactful Individual
You're right. This worked for me, then:
SalesFiltered =
VAR _Exclude =
CALCULATE (
SUM(dailyKPI[Sales]),
KEEPFILTERS ( dailyKPI[Warehouse] = "60"),
KEEPFILTERS ( dailyKPI[Month - Year] IN {"September 2020","October 2020", "November 2020", "December 2020", "August 2021","September 2021","October 2021"} )
)
RETURN
SUM(dailyKPI[Sales]) - _Exclude--NOTE: if possible, apply the filters to the dimension table (not the fact table)
- Aburar_1234 years ago
Solution Supplier
Hi,
You can try unchecking the "Show items with no data" option.
For Eg., in the below image i dont have any sales for the Descripton "ccc". since the "Show items with no data" has been checked it shows that record.
see it after uncheck this option,