Forum Discussion
Showing Up-Trending Sales
Dear All experts
Is there any good idea to show and highlight the stores with up-trending of sales in PowerbI? Say the following, I listed out the stores by row, and their weekly sales by column. Please kindly advise, thanks
Rgds
Fred
- Anonymous4 years ago
Hi Anonymous ,
I think you can try conditional formatting in matrix visual. As far as I know, Power BI only supports us to use conditional formatting in Value field instead of Row fields currently.
Measure = VAR _MAXWEEK = CALCULATE(MAX('Date'[WeekNum]),FILTER( ALL('Table'),'Table'[Value] <>BLANK())) VAR _SALE1 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),'Date'[WeekNum] = _MAXWEEK)) VAR _PREVIOUSWEEK = CALCULATE(MAX('Date'[WeekNum]),FILTER(ALL('Date'),'Date'[WeekNum]<_MAXWEEK)) VAR _SALE2 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),'Date'[WeekNum] = _PREVIOUSWEEK)) RETURN IF( _SALE1 - _SALE2>0,"Green","Red")Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- lbendlin
Super User
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - AnonymousNot applicable
Hi Anonymous ,
I think you can try conditional formatting in matrix visual. As far as I know, Power BI only supports us to use conditional formatting in Value field instead of Row fields currently.
Measure = VAR _MAXWEEK = CALCULATE(MAX('Date'[WeekNum]),FILTER( ALL('Table'),'Table'[Value] <>BLANK())) VAR _SALE1 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),'Date'[WeekNum] = _MAXWEEK)) VAR _PREVIOUSWEEK = CALCULATE(MAX('Date'[WeekNum]),FILTER(ALL('Date'),'Date'[WeekNum]<_MAXWEEK)) VAR _SALE2 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),'Date'[WeekNum] = _PREVIOUSWEEK)) RETURN IF( _SALE1 - _SALE2>0,"Green","Red")Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.