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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Conditional Formatting

As shown below, I have numbers going up and down on a daily basis. 

I am looking to add in two things here. 

 

If the number is higher or lower than the day before then a green arrow pointing down for lower and red arrow pointing up if higher, and also looking for the value of what either the increase or decrease is. 

I can't seem to figure this out with cell elements and simple DAX calculation (that I am still learning) is proving a challenge as well. 

 

Any help would be greatly appreciated. 

 

Scotsy_2707_0-1673369076859.png

 

Something similar to what can be done in Excel is what I am looking for

Scotsy_2707_1-1673369155120.png

 

 

 

3 REPLIES 3
jgeddes
Super User
Super User

I was using the Power Query editor in Power BI to make the initial transformations of the table. No Excel was used. 

If you click the transform data icon...

jgeddes_0-1673445992818.png

what do your text files look like in here?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

With this dataset it is a text files that is added into a folder and refreshed everyday, so any changes in excel would not be possible.

I do think that this is on the right path though, and I have tried to do a countif in BI creating a calculated column.

WRK Count = CALCULATE(FILTER('Daily','Daily'[Ref])

But getting the following error. 

Scotsy_2707_0-1673433017376.png

And here is some of the data

 

Scotsy_2707_1-1673433045600.png

 

If I can get this bit to work, then the rest should be pretty straightforward. 

jgeddes
Super User
Super User

There are a few ways to do this.
I started by creating a sample dataset that mimics what you shared.

jgeddes_0-1673374643084.png

I would first 'unpivot' this table based on the productID (renaming columns afterwards) to get...

jgeddes_8-1673375528395.png

 

jgeddes_1-1673374741660.png

You could use Power Query to get the previous day values, but I will show you in DAX

You can create a calculated column to get the previous day value...

previousDayValue = 
var _previousDay =
DATEADD(productValues[Date], -1, DAY)
var _previousDayValue =
LOOKUPVALUE(productValues[currentDayValue], [Date], _previousDay, productValues[productID], productValues[productID])
Return
_previousDayValue

And then create a calculated column that returns the difference between the current day and previous day...

previousDayVariation = 
IF(
    isblank(productValues[previousDayValue]),
    0,
    [currentDayValue] - [previousDayValue]
)

I had the formula return 0 if there was no previous day value, you can adjust that as you need.

Now you can create a Matix visual with productID as Rows, Date as Columns and Sum of previousDayValue as Values

jgeddes_2-1673375125870.png

You should have something like...

 

jgeddes_3-1673375161556.png

Now you can select the Format Visual->Cell Elements->Icons and turn that on

jgeddes_4-1673375249131.png

Making sure that the settings are applied to Sum of previousDayValue

hit the Fx button to edit the conditional formatting

jgeddes_6-1673375425897.png

Will get you...

jgeddes_7-1673375448305.png

Hope this gets you going in the right direction.


 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors