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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jovendeluna21
Helper IV
Helper IV

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]))

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.