Forum Discussion
Filter and summarize function
What made you choose KEEPFILTERS?
- mallap8493 years agoHelper I
Hi Ilebdlin,
I did so as to keep the impact of filter of
FILTER('Vehicle Parts', 'Vehicle Parts'[ACCOUNT_NAME] = "Vehicle Parts - Warehouse" )
Is that not correct?
Thanks!
- lbendlin3 years agoSuper User
KEEPFILTERS allows you to "add on" rather than "take away" (which is the default behavior for filters).
So when you say [Color]="blue" && [Color]="red" this means the color should be blue and red at the same time which usually results in BLANK(). But with KEEPFILTERS you can add the "red" filter to a context that is already filtered to "blue", effectively resulting in [Color]="blue" || [Color]="red" or simpler [Color] IN {"blue","red"}
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.- mallap8493 years agoHelper I
Sorry for some reason I cannot upload the .pbix file. But I hope screen shots below maske a better sense? Thank you, for the help!
Vehicle Parts - Table
From the above data I want to create a table that only selects – ACCOUNT_NAME “Vehicle Parts- Warehouse” and that groups by variables – TRANS_DATE, ORG, ORG NAME and SUM – TRANS VALUE
DAX used to create a new table.
Expense =
VAR K =
FILTER('Vehicle Parts', 'Vehicle Parts'[ACCOUNT_NAME] = "Vehicle Parts - Warehouse" )
RETURN
CALCULATETABLE(
SUMMARIZE(
'Vehicle Parts',
'Vehicle Parts'[TRANS_DATE].[Date],'Vehicle Parts'[ORG],'Vehicle Parts'[ORG_NAME],
"EXP" , SUM('Vehicle Parts'[TRANS VALUE])
),
KEEPFILTERS( k )
)
I want to create this table so that I can connect it with another table, below – Car Mileage Data, based two variables.
Car Mileage Data
Originally, I thought of create a table based on two tables above. Vehicle Parts data had Trans Value and Car Mileage Data has the METER_1_USAGE that I want in one table.
Regards,
Priyanka