cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Anonymous
Not applicable

## Conditional Formatting on Row level and baseline base on weight on previous weight

Dear all,

I need a chart or table to track changes in weight for each customer to determine whether there is any increase or decrease in weight compare to previous job date.

One of my ideas is to create a table in the format shown in the screenshot below.  If weight is lower than previous job date then the weight will show as red and having down arrow, and if weight is higher than previous job date then the weight will show as green and having up arrow.

However, there are some challenges with this table:

1.Conditional formatting only works on a column level instead of a row level.
2.Conditional formatting only allows for inputting fixed values for conditions.
3. I'm unsure of where to find the up and down arrow symbols.

Do you have any ideas on how to overcome the above challenges, or can you suggest any other methods for keeping track of the weight for each customer?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for your advise and idea, it is really awesome and show the challenges i faced.

However, it doesn't work what it suppose to be that it doesn't show red when the weight is lower than previous date.

Below are what i have done.

Create measue

Previous Weight =
VAR mydate = SELECTEDVALUE('Site with Frequent Fail Report'[Job Date])
VAR previousdate =
CALCULATE(
MAX('Site with Frequent Fail Report'[Job Date]),
'Site with Frequent Fail Report'[Job Date] < mydate)

RETURN
CALCULATE(
SUM('Site with Frequent Fail Report'[Weight kg]),
'Site with Frequent Fail Report'[Job Date] = previousdate)
------------------------------------------------------------
Weight RAG =
IF(
SUM('Site with Frequent Fail Report'[Weight kg]) < [Previous weight],
"Red", "Green")

but all show as green in the table

4 REPLIES 4
Super User

Create a measures to get the previous weight for the customer
and set a colour

``````Previous weight =
VAR mydate = SELECTEDVALUE(Sales[Date])
VAR previousdate =
CALCULATE(
MAX(Sales[Date]),
Sales[Date] < mydate)

RETURN
CALCULATE(
SUM(Sales[Weight]),
Sales[Date] = previousdate)``````

``````Weight RAG =
IF(
SUM(Sales[Weight]) < [Previous weight],
"Red", "Green")``````

Right click on the weight column, conditional formating, background colour,

format stsyle = Field value,

what field should this be based on = Weight RAG

Please click the accept solution buttom and thumbs up.

Anonymous
Not applicable

Thanks for your advise and idea, it is really awesome and show the challenges i faced.

However, it doesn't work what it suppose to be that it doesn't show red when the weight is lower than previous date.

Below are what i have done.

Create measue

Previous Weight =
VAR mydate = SELECTEDVALUE('Site with Frequent Fail Report'[Job Date])
VAR previousdate =
CALCULATE(
MAX('Site with Frequent Fail Report'[Job Date]),
'Site with Frequent Fail Report'[Job Date] < mydate)

RETURN
CALCULATE(
SUM('Site with Frequent Fail Report'[Weight kg]),
'Site with Frequent Fail Report'[Job Date] = previousdate)
------------------------------------------------------------
Weight RAG =
IF(
SUM('Site with Frequent Fail Report'[Weight kg]) < [Previous weight],
"Red", "Green")

but all show as green in the table

Super User

The solution I provided works!

It does exactly what you ask for and shows red if the weigh is is less than the previous value
Or green if the value is greater than the previous value.
Please click [accept solution] because it does exacaly what you asked for, I spent a lot of time and effort on it and I deserve the kudos.

Sorry only one topic per question.

If you want somethimg different them please raise a new ticket .

Please dont post your buggy DAX that does not work and expect use to know what on you need.

Plase do provide example input data as a formated table that we can easily import (not a screen print) an example desired output and a clear step by step desription.

Now please do the polite thing and click [accept solution].

Thanks

Super User

following

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors