Forum Discussion

Jpahl2033's avatar
Jpahl2033
Icon for Helper I rankHelper I
4 years ago
Solved

Only Highlight that meets a certain threshold weekly

hi,

 

 

I was curious if it possible to create a report where the only items that show up that meet a certain threshold when the data is refreshed. I have provided a small sample set for reference along with a example below. 

 

 7/20/20227/21/20227/22/20227/23/20227/24/20227/25/20227/26/20227/27/20227/28/2022
 Week 1Week 1Week 1Week 2Week 2Week 2Week 3Week 3Week 3
Item A310143231523
Item B34521221522
Item C410121222222

 

I want to be able to show where there is a variance of more than 30% between the weeks. So if the difference between week 2 and week 1 there is a 30% difference, it will highlight, but if it is less than 30%, it will not highlight. I have already created a daily threshold, but it doesn't seem to work if i group the day's together into weeks. See below for my threshold for daily. The week names and days are in the Date Table.

 

Colour =
VAR _date =
MAX ( 'Date Table'[Day] )
VAR _p_date = _date - 1
VAR _value1 = [Total Spend]
VAR _value2 =
CALCULATE (
[Total Spend],
'Date Table'[Day] = _p_date,
ALLEXCEPT ( 'Query1', 'Query1'[Correct Brand])
)
VAR _result =
IF ( ABS ( (_value2 - _value1)/_value2 ) >= 0.3 && _value2 <> BLANK (), "red" )
RETURN
_result

 

Let me know if you have any questions or comments. Happy to explain more! 

3 Replies

  • This is a standard Week-over-week pattern and you can use conditional formatting for the highlighting.

     

    However your sample data is in an unfortunate format, not conducive for processing.  At the minumum you should unpivot it to convert it from wide to long.

     

    Your sample dates also do not agree with your week numbers.  Either omit the week number and calculate it from DAX, or provide correct sample data.

  • hello lbendlin,

     

    Please see the link below for the pbix file that showcases a new table where the items are grouped by the week code. Let me know if this clarifies things from the above. 

    Powerbi File