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
Anonymous
Not applicable

Card Visual implementation using arrow

I have table like below cluculated total Business with below queary and it is giving correct output but need to caluculate total past year business with this year 2020 vs 2021, if this year business value high i need to show green up arrow in card visual and if value is less with then need to show down red arrow in Card visual. Please let me know how to implement.

 

Business = SUMX(FILTER('Table1', 'Table1'[Status] = "Draft"), INT('Table1'[Value])) + SUMX(FILTER('Table1', 'Table1'[Status] = "In Process"), INT('Table1'[Value]))
 
ItemsCreatedDateStatusValue 
Item120-Jan-2020Draft10000 
Item225-Feb-2021In Process20000 
Item316-Jan-2020Draft30000 
Item402-Mar-2021Inprocess40000 

 

For card visual arrow I want to use this Queary

Trend =
VAR Down = UNICHAR(11167)
VAR Up = UNICHAR(11165)
RETURN
IF([%Chg vs LY] < 0, Down, IF([% Chg vs LY] > 0.1, Up, Side))
1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Flag =
var _thisyear=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR('Table'[CreatedDate])=YEAR(TODAY())))
var _lastyear=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR('Table'[CreatedDate])=YEAR(TODAY())-1))
return
IF(
    _thisyear >_lastyear,UNICHAR ( 9650 ),UNICHAR ( 128315 ))

2. There seems to be no green arrow in unichar, so we can set it to green by clicking Format – Data label – Color.

vyangliumsft_0-1639964744450.png

3. Result:

vyangliumsft_1-1639964744453.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Flag =
var _thisyear=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR('Table'[CreatedDate])=YEAR(TODAY())))
var _lastyear=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR('Table'[CreatedDate])=YEAR(TODAY())-1))
return
IF(
    _thisyear >_lastyear,UNICHAR ( 9650 ),UNICHAR ( 128315 ))

2. There seems to be no green arrow in unichar, so we can set it to green by clicking Format – Data label – Color.

vyangliumsft_0-1639964744450.png

3. Result:

vyangliumsft_1-1639964744453.png

 

Best Regards,

Liu Yang

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

@Anonymous , with help from date table, you have few option for this year vs last year

 

YTD Sales = CALCULATE([Business],DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE([Business],DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE([Business],DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE([Business],DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE([Business],DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

 

This Year = CALCULATE([Business],filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE([Business],filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
rolling = CALCULATE([Business],filter(ALL('Date'),'Date'[Year]>=max('Date'[Year])-2 && 'Date'[Year]<=max('Date'[Year])) )

 

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

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

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.

Top Solution Authors