Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Help with Report

I have a report in which one tab shows new accounts and accounts that dropped out of the data.  They are shown in two separate tables.  There is a slicer on the page for Quarter. Example: Accoun...
  • v-angzheng-msft's avatar
    4 years ago

    Hi, Anonymous 

     

    Please try the following steps:

    1. Create a calculation table

    Quarter = SUMMARIZE('Table',[Quarter])

    And to create a slicer with the summarized quarter field.

     

    2. Create a calculated column

    YQ_index = YEAR('Table'[Date])*10+QUARTER('Table'[Date])

    3. Create a measure

    NEW/OLD/OUT = 
    
    VAR _CURRENT_T=FILTER(ALL('Table'),'Table'[Quarter]=SELECTEDVALUE('Quarter'[Quarter]))
    VAR _CURRENT_YQ=MAXX(_CURRENT_T,[YQ_index])
    
    VAR _CURRENT_Q_List=SUMMARIZE(_CURRENT_T,[Account])
    
    VAR _PRE_YQ=MAXX(FILTER(ALL('Table'),'Table'[YQ_index]<_CURRENT_YQ),[YQ_index])
    VAR _PRE_Q_List=SUMMARIZE(FILTER(ALL('Table'),'Table'[YQ_index]=_PRE_YQ),[Account])
    
    VAR _CURRENT_Account=MAX('Table'[Account])
    VAR _IF=
            SWITCH(
                TRUE(),
                _CURRENT_Account IN _CURRENT_Q_List && _CURRENT_Account IN _PRE_Q_List,"OLD",
                _CURRENT_Account IN _CURRENT_Q_List && NOT(_CURRENT_Account IN _PRE_Q_List),"NEW",
                NOT(_CURRENT_Account IN _CURRENT_Q_List) && _CURRENT_Account IN _PRE_Q_List,"OUT")
    return _IF

     

    Result:

     

    Please refer to the attachment below for details. Hope this helps.

     

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.