Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
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?

 

PaulineJW_0-1698763296770.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @speedramps 

 

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")
 

PaulineJW_0-1698852212081.png

 but all show as green in the table

PaulineJW_1-1698852417782.png

 

View solution in original post

4 REPLIES 4
speedramps
Super User
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

speedramps_0-1698766248785.png

 

Please click the accept solution buttom and thumbs up.

 

 

 

Anonymous
Not applicable

Hi @speedramps 

 

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")
 

PaulineJW_0-1698852212081.png

 but all show as green in the table

PaulineJW_1-1698852417782.png

 

The solution I provided works!

Click here to download solution 

 

speedramps_0-1698857800991.png

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.
Quote @speedramps and I will receive an automated notification and will be happy to help you.


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

Thanks

speedramps
Super User
Super User

following

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.