Filter Summarize Column

Hi,

How i can filter this summarize table. Let say my dataset have three years. But I want to see only two years only inside this summarize table. How I can do that. Also, I attached one power bi from Apex Insights to play around with.
Retail Customer Analytics.pbix (8.2 MB)

Dim Customer = 
SUMMARIZE (
    'Invoice Details',
    'Invoice Details'[Customer ID],
    "First Sales Month", EOMONTH ( FIRSTDATE ( 'Invoice Details'[Invoice Date] ), 0 ),
    "Last Sales Month", EOMONTH ( LASTDATE ( 'Invoice Details'[Invoice Date] ), 0 ),
    "Months with Sales", CALCULATE(DISTINCTCOUNT('Dim Date'[End of Month]))
    )

@Amirul ,

Here’s how to filter your summarized table using the OR operator ( || ). Also note that you should not use SUMMARIZE if you are adding new DAX columns to a table, as it can produce inaccurate results. Instead, use ADDCOLUMNS (or ADDCOLUMNS in conjunction with SUMMARIZE).

CALCULATETABLE(
    ADDCOLUMNS(
        VALUES( 'Invoice Details'[Customer ID] ),
        "First Sales Month", EOMONTH( FIRSTDATE( 'Invoice Details'[Invoice Date] ), 0 ),
        "Last Sales Month", EOMONTH( LASTDATE( 'Invoice Details'[Invoice Date] ), 0 ),
        "Months with Sales", CALCULATE( DISTINCTCOUNT( 'Dim Date'[End of Month] ) )
    ),
    'Dim Date'[Year] = 2010
        || 'Dim Date'[Year] = 2011
)

Here’s an article if you want to understand more about the SUMMARIZE/ADDCOLUMNS combination.

I hope this is helpful.

  • Brian

Hi @Amirul, did the response provided by @BrianJ help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.

I hope that you are having a great experience using the Support Forum so far. Kindly take time to answer the Enterprise DNA Forum User Experience Survey, we hope you’ll give your insights on how we can further improve the Support forum. Thanks!

Hi @Amirul, we’ve noticed that no response has been received from you since July 5th. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi @Amirul, due to inactivity, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.

Kindly take time to answer the Enterprise DNA Forum User Experience Survey, we hope you’ll give your insights on how we can further improve the Support forum. Thanks!