Forum Discussion
quickbi
2 years agoHelper II
Color deppending previous week column
Hi, I have a table with sales per city and week. I want to paint the week column that is better than previous in green and in red if it's negative. Is it possible to do it in PBI? This is what i wa...
manvishah17
2 years agoSolution Supplier
Hi quickbi ,
Yes you can achieve it by conditional formatting in PBI ,
I created a sample dataset and get this output ,
You can use this measure and the plot it in FX OF YOUR COLUMN OPT IN FORMAT OPT.
Difference =
VAR CurrentWeek = SELECTEDVALUE('DateTable'[WeekNoYear])
VAR CurrentWeekSales = CALCULATE(SUM('Order Data'[Sales]), 'DateTable'[WeekNoYear] = CurrentWeek)
VAR PreviousWeekSales = CALCULATE(SUM('Order Data'[Sales]), 'DateTable'[WeekNoYear] = CurrentWeek - 1)
RETURN
IF(
CurrentWeekSales - PreviousWeekSales >0 ,
"green",
"red"
)If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
- quickbi2 years agoHelper II
Hi,
thanks for the answer, where do I have to put this measure, I can't reach your result.Thanks