Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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

  • Anonymous's avatar
    Anonymous
    4 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 Zhou

     

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not 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 Zhou

     

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