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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
abukapsoun
Post Patron
Post Patron

Average & conditional formatting

Hi Gents,

 

Need your expertise please, 

I have the following table

 

CostJanuaryFebruaryMarch....August
ItemX10255....250
ItemY253070....30

 

 

I get this table periodically at each month. At each month, taking the example of August I would like to check the average of all previous periods and if the cost of August is higher than the average, then i highlight the cell with a color, for example red or something. so it means cost of ItemX should be highlight in Red, and itemY still within average. 

Would that be possible? If not, with conditional formatting at least with something that tell cost of itemX in August is above average.

 

Thanks,

 

1 ACCEPTED SOLUTION

@abukapsoun So, I would go into Power Query, select your Items column, right-click and choose Unpivot other columns. That should make everything you are trying to do much, much easier. @ me if you need me.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Greg_Deckler
Community Champion
Community Champion

@abukapsoun Is that your actual source data? Do you have an actual date column to work with? If that is your actual data as it comes in from the source you will want to right-click your first column and choose Unpivot outher columns. Then you are going to need a table in your data model like:

Month Rank
January 1
February 2
March 3

Anyway, I hate to go into detail until I know about an actual date column or not.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

In fact thats how exactly the data look like

 

ItemsP01P02P03....P08
item1102010....500
item210155....10

.

      

.

      

.

      

 

 

the P01, P02.. represent periods, like months.

 

Every month I get an updated period that I add to the table. So if we say we are now September, i would want to analyse the figures of August. 

 

I would want to highlight the items that are in August having value, higher than the average of the whole period. 

 

So in September I come and look at the values of P08. If P08 value of Item1 is higher than the average of all previous periods (P1 -> P7) then I highlight the value in red. if not, we leave it.

I would need to repeat the same on every period, so if we are next in October, I would want to analyse the values of P09 while considering the average (P1-> P8). 

 

I hope I could make it clear enough.

 

Thanks a lot in advance,

 

 

@abukapsoun So, I would go into Power Query, select your Items column, right-click and choose Unpivot other columns. That should make everything you are trying to do much, much easier. @ me if you need me.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks you!

 

Thanks. Done that, but then what? 

Would I be able to apply the conditional formatting to the column values if it is above the average? 

 

amitchandak
Super User
Super User

@abukapsoun ,

If you are getting data only monthly and you can have date or rank on month

 

Cumm Sales = CALCULATE(Average(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,max(dateadd(date[date]),-1,Month))))

 

Cumulative a month before. If you getting daily data then sum the data and divide by distinct month

 

Use the date table

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for your reply, but I didnt really get the formula. 

 

Is that a measure? moreover I can see in the formula [Sales Amount] column, to which column exactly in my table that refers to? I dont have such column

 

can we do it without using the date? because in fact i dont have them as months but instead P01, P02, P03, instead of January, Feb, March..

 

Thanks again

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.