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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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