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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jovendeluna21
Helper III
Helper III

How to have arrow down and arrow up KPI comparing previous date and current date?

Hello,

Anyone can help me how to have arrow down and arrow icon comparing previous date and current date? When the number from the previous day decrease arrow should automatically down and when increase the arrow is up.

I am aiming just like below image.

I have attached here in this link the power bi file.

https://drive.google.com/file/d/176Yq9Bv4uhSMXJ9Qz91vv9ZK5n1rlUtZ/view?usp=sharing

 

Your help will be highly appreciated. 

 

cases.PNG

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @jovendeluna21 ,

 

You need to create three measure for each line chart. For example, HospitalizedCurrently:

 

HospiyalizedCurrentlyDiff = CALCULATE(SUM('all-states-history'[hospitalizedCurrently]),FILTER('all-states-history','all-states-history'[date] = TODAY())) -CALCULATE(SUM('all-states-history'[hospitalizedCurrently]),FILTER('all-states-history','all-states-history'[date] = TODAY()-1)) //Compare value between today and yesterday

 

HospitializedCurrentlyArrow = IF([hospiyalizedCurrentlyDiff]>=0,UNICHAR(9650),UNICHAR(9660)) //Show arrow for value

 

colorforhosipalizedCurrently = IF([hospiyalizedCurrentlyDiff]>=0,"green","red") //Show color for arrow

 Put the last measure in color format for data label:

Capture2.PNGCapture3.PNG

 

Capture4.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

 

View solution in original post

6 REPLIES 6
v-deddai1-msft
Community Support
Community Support

Hi @jovendeluna21 ,

 

You need to create three measure for each line chart. For example, HospitalizedCurrently:

 

HospiyalizedCurrentlyDiff = CALCULATE(SUM('all-states-history'[hospitalizedCurrently]),FILTER('all-states-history','all-states-history'[date] = TODAY())) -CALCULATE(SUM('all-states-history'[hospitalizedCurrently]),FILTER('all-states-history','all-states-history'[date] = TODAY()-1)) //Compare value between today and yesterday

 

HospitializedCurrentlyArrow = IF([hospiyalizedCurrentlyDiff]>=0,UNICHAR(9650),UNICHAR(9660)) //Show arrow for value

 

colorforhosipalizedCurrently = IF([hospiyalizedCurrentlyDiff]>=0,"green","red") //Show color for arrow

 Put the last measure in color format for data label:

Capture2.PNGCapture3.PNG

 

Capture4.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

 

Can you please share the pbix file? It will be helpful for me. Thank you!

Hi @jovendeluna21,

 

Please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ETdFI84bFilJsWhqOO...

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

TomMartens
Super User
Super User

Hey @jovendeluna21 ,

 

you can create a measure that creates an svg image that you then can put inside card visual, here is an example:

Simple SVG KPI (Power BI august 2018 update) - Microsoft Power BI Community

 

You can also use the DAX function UNICHAR. This DAX creates a friendly smiley

vizAid frinedly smiley = UNICHAR( 128512 )

I put the measure inside a card visul and place the visual accordingly, like so:

 

HTML Smiley Emoji (w3schools.com)

and of course not just smileys.

 

Hopefully this provides you some ideas on how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thank you, however I'm not able to come up based on my dataset. Can you help me.

https://drive.google.com/file/d/176Yq9Bv4uhSMXJ9Qz91vv9ZK5n1rlUtZ/view?usp=sharing

amitchandak
Super User
Super User

@jovendeluna21 , Actually you can create a card visual with an up and down arrow and use that.

Example : https://www.youtube.com/watch?v=veCtfP8IhbI

https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692

 

Take a diff this day vs last day with help from date table

This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('order'[Qty]), previousday('Date'[Date]))

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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