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
anithaMallam
Helper III
Helper III

Indicators in Score Card

Hi All,

           I need your help in showing the comparision of sales to current and last year sales.If last year  sales is lower than current year in the score card below total sales value by what percentage last year sales is lower it should be displayed with an indicator with down arrow and if previous year sales is greater than current year it has to show up arrow below the total sales values in score card.Could some one please help me on this.

 

Regards

Anitha

1 ACCEPTED SOLUTION

Hi @anithaMallam 

Due to I don‘t know your data model, I build a sample table with Date column and Sales column to have a test.

1.png

Measure:

Icon = 
VAR _Current =
    SUMX (
        FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) ),
        'Table'[Sales]
    )
VAR _Previous =
    SUMX (
        FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) - 1 ),
        'Table'[Sales]
    )
RETURN
    IF ( _Previous < _Current, "⇩", "⇧" )

And you can use UNICHAR(9650)/ UNICHAR(9660) in Measure as well.

Sales in Lastyear is greater than current year, so measure will return to up arrow in your logic. Result is as below.

2.png

You can download the pbix file from this link: Indicators in Score Card

 

Best Regards,

Rico Zhou

 

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

View solution in original post

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

Hi @anithaMallam 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

anithaMallam
Helper III
Helper III

Hi Amit,

               

Icon = 
VAR theIndicator = [Parameter Value]
RETURN
   SWITCH (
            TRUE(),
            theIndicator = 1, UNICHAR(9650),
            theIndicator = 0, UNICHAR(9654),
            theIndicator = 2, UNICHAR(9660)
            )

in the place of [ Parameter value  ] in the above logic can i take %diff of current and last year sales value.

 

Regards

Anitha

Hi @anithaMallam 

Due to I don‘t know your data model, I build a sample table with Date column and Sales column to have a test.

1.png

Measure:

Icon = 
VAR _Current =
    SUMX (
        FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) ),
        'Table'[Sales]
    )
VAR _Previous =
    SUMX (
        FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) - 1 ),
        'Table'[Sales]
    )
RETURN
    IF ( _Previous < _Current, "⇩", "⇧" )

And you can use UNICHAR(9650)/ UNICHAR(9660) in Measure as well.

Sales in Lastyear is greater than current year, so measure will return to up arrow in your logic. Result is as below.

2.png

You can download the pbix file from this link: Indicators in Score Card

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@anithaMallam , For up and down arrow, You can refer this solution from past. Using UNICHAR and color measure.

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

 

For this year vs last year. With the date table, you can use

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
//Only year vs Year, not a level below

 


This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

Also refer : https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi

Appreciate your Kudos.

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.