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

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

Reply
shahbaznawaz37
Regular Visitor

Highlight Value if Value is Less then previous date in matrix

I am new to Power BI I want to highlight the value in matrix visual if its less then pervious date value. for example, Van_no 0016 & 1005 have less mileage on 08-Apr-20 as compare to 07-Apr-20 and the same condition is for 06-Apr-20 vs 07-Apr-20 also.

 

Mileage.JPG

thanks in advance.

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @shahbaznawaz37 

 

If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Dear All,

 

Not found any solution from the community I tried a lot but failed.

 

Total Mi flag =
VAR vMeasure = [Total Mi]
VAR vDate = MAX(daily_delivery_report[ddr_date])
VAR vPrevious = CALCULATE([Total Mi],FILTER(daily_delivery_report,(vDate - 1)))
RETURN
IF(vMeasure < vPrevious,1,0)
 
Above formula is showing everywhere 0 
 Capture2.JPG
Greg_Deckler
Community Champion
Community Champion

You probably want to create a flag measure like:

 

Flag Measure = 

  VAR __Measure = [Current Measure]

  VAR __Date = MAX('Table'[Date])

  VAR __Previous = CALCULATE([Current Measure],FILTER('Table',(__Date - 1)))

RETURN

  IF(__Measure < __Previous,1,0)



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...

can you please correct below because I am unable to put the column name without function.

 

Flag Measure =

VAR __Measure = MAX(daily_delivery_report[mileage_in])

VAR __Date = MAX(daily_delivery_report[ddr_date])

VAR __Previous = CALCULATE(MAX(daily_delivery_report[mileage_in]),FILTER(daily_delivery_report,(__Date - 1)))

RETURN

IF(__Measure < __Previous,1,0)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors