Forum Discussion

MichaelaMul's avatar
MichaelaMul
Helper III
1 year ago
Solved

Identify New Value compared to Prior Period

Hi! I'm trying to figure out if there's a way to identify the new geography compared to the week prior. For example, in this example I would want to identify that Store L, Store M, and Store N was a...
  • ahmedoye's avatar
    1 year ago

    Here is how you can write a measure, and then use the measure in a Conditional Format on the Table:

     

    1. Create a Measure (as indicated after this list)
    2. Go to format your Table visual, under Cell Elements, Toggle on the Background Color
    3. In the Conditional Formatting Setting, change the format style to Field Value
    4. Select the measure you have newly created and click Ok.
    5. See the measure below:

     

        VAR SelectedWeek = SELECTEDVALUE('Table'[Week Num])
        VAR PriorWeek = SelectedWeek - 1
        VAR StoresCurrWeek = SELECTCOLUMNS(
            FILTER(
                ALL('Table'),
                'Table'[Week Num] = SelectedWeek
            ),
            "Stores", 'Table'[GeographyTOTAL?]
        )
        VAR StoresLastWeek = SELECTCOLUMNS(
            FILTER(
                ALL('Table'),
                'Table'[Week Num] = PriorWeek
            ),
            "Stores", 'Table'[GeographyTOTAL?]
        )
        VAR NewStores = EXCEPT(
            StoresCurrWeek,
            StoresLastWeek
        )

        RETURN
            IF(
                SELECTEDVALUE('Table'[GeographyTOTAL?]) IN NewStores,
                "Green"
            )
     
    If this works for you, kindly mark as answer to allow anyone with similar challenges find the solution.