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
vijethshetty22
Frequent Visitor

Unable to display trend arrows in table visual.

Hello,

I am looking for options to display trend image (Up or Low Arrows) for my sales values w.r.t MOM (month on month) changes.

I had gone through http://community.powerbi.com/t5/Desktop/up-arrow-show-a-shape-based-on-a-formula/td-p/15823 but still could not find solution for my issue.

 

Below is the complete description of task I am trying to perform.
I am using two excel files as input. Below is the content of 2 excel.
1. Sales
---------------
Date Sales
Apr-16 809
May-16 719
Jun-16 698
Jul-16 788
Aug-16 749
Sep-16 902
Oct-16 1017
Nov-16 1138
Dec-16 1371
Jan-17 1368
Feb-17 1254
Mar-17 937


2. Key Excel
------------
Key Value
1 https://thumb.ibb.co/ns9zQa/Up_Arrow.png
2 https://thumb.ibb.co/ePvTJv/down_arrow.png

 

In 2nd excel the URL points to the image to be displayed.

 

 

Used below 3 measures to display the % Change in sales.

 

Total Sales = SUM(Sales[Sales])
Previous Month Sales = CALCULATE([Total Sales], PREVIOUSMONTH(Sales[Date]))
% Change Sales = DIVIDE([Total Sales],[Previous Month Sales],BLANK())-1

 

To display the arrow key for the trend i have used multiple approaches (measure and Custom column) but none is working. Below is the details of measures/columns.


First 2 are measures. Last one is custom column.

 

1. Sales Key = IF([% Change Sales]>0,"⇧", "⇩")
Comment - This works but i would like to have images rather than the ASCII arrows.

2. Sales Key 2 = IF([% Change Sales]>0,"https://thumb.ibb.co/ns9zQa/Up_Arrow.png", "https://thumb.ibb.co/ePvTJv/down_arrow.png")
Comment - This is displaying the URL's correctly. But as Data Category of a measure cannot be changed (to Image URL), I am unable to get the image out of it.

3. Sales Key Column = IF([% Change Sales]>0,"https://thumb.ibb.co/ns9zQa/Up_Arrow.png", "https://thumb.ibb.co/ePvTJv/down_arrow.png")
Comment - By changing the data category, this displays the image but irrespective of '% Change Sales' of individual months, it always displays Down Arrow.


I have placed all the above measures in a Table visual. Below is the screen shot of the same.

 

Arrow_Issue.JPG

 

Thanks in advance for you help !!

 

 

 

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

Hi @vijethshetty22,

 

Since measure no support to modify the data category, if you want to show the image, you have to use calculate column.

 

According to my research, your measure contians some dax formula which based on the filter effect of visual. Calculate column is an pretreatment column, if you directly use above formulas in calculate column, it will caused the issue.

 

Capture.PNG

 

To work through this issue, you can take a look at below calculated column formulas:

 

Total Sales 2 = SUMX(FILTER(ALL(Sales),[Date]=EARLIER(Sales[Date])),Sales[Sales])

Previous Month Sales 2 = SUMX(FILTER(ALL(Sales),[Date].[MonthNo]=EARLIER(Sales[Date].[MonthNo])-1),Sales[Sales])

% Change Sales 2 = DIVIDE([Total Sales 2],[Previous Month Sales 2],BLANK())-1

Sales Key 2 = 
IF([% Change Sales 2]>0,"https://thumb.ibb.co/ns9zQa/Up_Arrow.png", "https://thumb.ibb.co/ePvTJv/down_arrow.png")

 

Capture2.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @vijethshetty22,

 

Since measure no support to modify the data category, if you want to show the image, you have to use calculate column.

 

According to my research, your measure contians some dax formula which based on the filter effect of visual. Calculate column is an pretreatment column, if you directly use above formulas in calculate column, it will caused the issue.

 

Capture.PNG

 

To work through this issue, you can take a look at below calculated column formulas:

 

Total Sales 2 = SUMX(FILTER(ALL(Sales),[Date]=EARLIER(Sales[Date])),Sales[Sales])

Previous Month Sales 2 = SUMX(FILTER(ALL(Sales),[Date].[MonthNo]=EARLIER(Sales[Date].[MonthNo])-1),Sales[Sales])

% Change Sales 2 = DIVIDE([Total Sales 2],[Previous Month Sales 2],BLANK())-1

Sales Key 2 = 
IF([% Change Sales 2]>0,"https://thumb.ibb.co/ns9zQa/Up_Arrow.png", "https://thumb.ibb.co/ePvTJv/down_arrow.png")

 

Capture2.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft,

 

Thanks a lot. This helps. Solved my problem.

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.