Forum Discussion

fabdata1207's avatar
fabdata1207
Regular Visitor
4 years ago

Create a column with Trend

Hi Guys,

I have the data below and basically I need to build a measure for TREND to show the progress from rating 1 to rating 2

I have 3 values for each rating being Low, Medium and High.

So I need to build a simple logic as following:

Low > Low = 1

Low > Medium = 2

Low > High = 3

then I can use that in conditional formating to use arrows.

The challenge here is that Rating 1 and Rating 2 are dax measures.

RATING 1RATING 2TREND
LOWLOW 
LOWMEDIUM 
LOWHIGH 
LOWHIGH 
LOWHIGH 
HIGHLOW 
HIGHLOW 
HIGHLOW 
HIGHLOW 
MEDIUMMEDIUM 
MEDIUMLOW 
MEDIUMLOW 

 

 

Any ideas?

 

Thanks

3 Replies

  • MahyarTF's avatar
    MahyarTF
    Memorable Member

    Hi,

    In my point of view, if there are two columns in spreadsheet :

     

    - I added two columns in Power Query :

    RATING 1 = if [Rating 1 value] = 1 then "LOW" else if [Rating 1 value] = 2 then "MEDIUM" else "HIGH")

    RATING 2 = if [Rating 2 value] = 1 then "LOW" else if [Rating 2 value] = 2 then "MEDIUM" else "HIGH")

    Then for now about the trend for each row, need to create the below Column Measure :

    TREND =
    Var distinctValue = Sheet13[Rating 2 value] - Sheet13[Rating 1 value]
    Var Result = if( distinctValue >= 0,
                     if (distinctValue > 1 , 3,
                        if (distinctValue > 0 , 2, 1)
                        ),
                     0
                     )
    Return Result
    Hop it will be useful
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi fabdata1207 ,

    What's your expected result? Do you want to apply conditional formatting for rating1 and rating 2? And create a trend line between Rating 1 and Rating 2?

    Best Regards