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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
curiouspbix0
Helper IV
Helper IV

compare previous value

What is the efficient dax to compare current value to previous value to derive up and down arrows ?

 Input Table 

City         Station   Measurement  Time 

Brooklyn   S1         1.3                   08/27/2020 7:00 am 

Brooklyn   S1         1.4                   08/27/2020 7:30 am 

Brooklyn   S1         1.5                   08/27/2020 8:00 am 

Brooklyn   S1         1.5                   08/27/2020 8:30 am 

Brooklyn   S1         1.3                   08/27/2020 9:00 am 

Brooklyn  S2         3.4                   08/27/2020 7:30 am 

Brooklyn  S2         4.5                   08/27/2020 8:00 am 

Brooklyn  S2         5.5                   08/27/2020 8:30 am 

 

Output

 

Brooklyn S1 Down Arrow 

Brookyn S2 Up Arrow

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@curiouspbix0 

Please try this measure; you can also use the Icon Set in Conditional Formatting with slight modIfication to this measure. 

 

UpDown = 
VAR D = MAX(Brooklyn[Time ])
VAR PD=
    CALCULATE(
        MAX(Brooklyn[ Measurement ]),
       Brooklyn[Time ] < D
    )
VAR DIF = 
IF( 
    ISBLANK(PD), BLANK(),
    
    IF ( MAX(Brooklyn[ Measurement ]) - PD >= 0 , UNICHAR ( 9650 ), UNICHAR ( 128315 ))
)

RETURN
DIF

 

Fowmy_0-1598601960434.png

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@curiouspbix0 

Please try this measure; you can also use the Icon Set in Conditional Formatting with slight modIfication to this measure. 

 

UpDown = 
VAR D = MAX(Brooklyn[Time ])
VAR PD=
    CALCULATE(
        MAX(Brooklyn[ Measurement ]),
       Brooklyn[Time ] < D
    )
VAR DIF = 
IF( 
    ISBLANK(PD), BLANK(),
    
    IF ( MAX(Brooklyn[ Measurement ]) - PD >= 0 , UNICHAR ( 9650 ), UNICHAR ( 128315 ))
)

RETURN
DIF

 

Fowmy_0-1598601960434.png

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@curiouspbix0 , display with city and station

measure =
calculate(sum(Table[Measurement]), filter(Allselected(Table[Time]), table[Time] =max(Table[Time]))) -calculate(lastnonblankvalue(Table[Time],sum(Table[Measurement])), filter(Allselected(Table[Time]), table[Time] <max(Table[Time])))

 

you can write logic for up and down

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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