Forum Discussion
MichaelaMul
1 year agoHelper III
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...
- 1 year ago
Here is how you can write a measure, and then use the measure in a Conditional Format on the Table:
- Create a Measure (as indicated after this list)
- Go to format your Table visual, under Cell Elements, Toggle on the Background Color
- In the Conditional Formatting Setting, change the format style to Field Value
- Select the measure you have newly created and click Ok.
- See the measure below:
VAR SelectedWeek = SELECTEDVALUE('Table'[Week Num])VAR PriorWeek = SelectedWeek - 1VAR 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)RETURNIF(SELECTEDVALUE('Table'[GeographyTOTAL?]) IN NewStores,"Green")If this works for you, kindly mark as answer to allow anyone with similar challenges find the solution.
ahmedoye
1 year agoResponsive Resident
Here is how you can write a measure, and then use the measure in a Conditional Format on the Table:
- Create a Measure (as indicated after this list)
- Go to format your Table visual, under Cell Elements, Toggle on the Background Color
- In the Conditional Formatting Setting, change the format style to Field Value
- Select the measure you have newly created and click Ok.
- 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.