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
srkase
Helper IV
Helper IV

COMPARE YEAR VALUES AND SHOW THE DIFFERENCE IN ICONS

i have the data like this..

 

NAMEYEARSALES
A20152016100
B20152016105
A20162017110
B20162017102
A20172018102
B20172018110
A20182019125
B20182019120
A20192020100
B20192020100

 

Now the result in matrix is 

NAME         20152016  20162017 20172018   20182019 20192020

A100110102125100
B105102110120100

 

What i want is 

 

compare value between years and show the result in symbols or icons in a separate column

3.jpg

Kindly help in this regards and thanks in advance

7 REPLIES 7
v-eachen-msft
Community Support
Community Support

Hi @srkase ,

You need to create a calculated column:

Trend =
VAR os =
    CALCULATE (
        FIRSTNONBLANK ( test[SALES], 1 ),
        FILTER (
            test,
            test[YEAR]
                = EARLIER ( test[YEAR] ) - 10001
                && test[NAME] = EARLIER ( test[NAME] )
        )
    )
VAR if1 =
    IF ( NOT ( ISBLANK ( os ) ), test[SALES] - os )
VAR up =
    UNICHAR ( 129029 )
VAR down =
    UNICHAR ( 129031 )
VAR nochange =
    UNICHAR ( 9644 )
RETURN
    IF (
        if1 > 0,
        up,
        IF ( if1 = BLANK (), BLANK (), IF ( if1 = 0, nochange, down ) )
    )

Then you can use Matrix visual to get result. Please turn off the row/column subtotals.

2-2.PNG

 

 



2-1.PNG

 

 

 

 

 

If you want learn more about UNICHAR(), you can refer to this document.
https://www.vertex42.com/ExcelTips/unicode-symbols.html

Note: This link contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

 

Best Regards,

Eads

 

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

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

4.jpg

Hi @srkase ,

 

Please check the data type of PROD_CABLE[YEAR] and PROD_CABLE[TOTAL_CR], they need to be whole number or decimal number. Or you can use VALUE() to format them.

 

Best Regards,

Eads

 

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

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

the results are not showing correclty..the results are not showing correclty..

Hi @srkase ,

 

I saw a column "MAJOR GROUP" in your code. What does it mean? You can try to replace "MAJOR GROUP" with "CATEGORY".

 

Best Regards,

Eads

 

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

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

I TRIED WITH REPLACING WITH CATEGORY TOO,... BUT IT DOESNT WORKS

 

I AM NOW GIVING THE SAMPLE DATA STRUCTURE...  I tried with all possibilities.. am using desktop BI ..

 

YEARSHORTNAMEDEALERTYPEMAJOR GROUPMINOR GROUPSUB GROUPPRODUCTVARIANTAPRMAYJUNJULAUGSEPOCTNOVDECJANFEBMARTOTAL QTYTOTALVALPTA_DESTINATIONUNIT_CODEPTA_DISTRICTPTA_TALUKPTA_PINACP_ENTRYDTHPPERAPR VALMAY VALJUN VALJUL VALAUG VALSEP VALOCT VALNOV VALDEC VALJAN VALFEB VALMAR VALTOTAL CRDLR NAME_DESTDEST_DST_PINDST_DEST_PINPIN_DEST_DSTCATEGORY
20172018TCRASTDSUBMERSIBLES6" SETEMS+ESRSEMS7MS + ESRS31-2333AAA + 13FAA100000000000115000 ASE1   ########7.500000000000000    PRODUCT
20172018TCRBSTDSUBMERSIBLES6" SETEMS+ESRSEMS5MS + ESRS31-1533AAA + 13FAA100000000000115000 ASE1   ########500000000000000    PRODUCT
20182019TCRASTDSUBMERSIBLES6" SETEMS+ESRSEMS7MS + ESRS51-0833AAA + 13FAA100000000000115000 ASE1   ########7.500000000000000    PRODUCT
20192020TCRASTDSUBMERSIBLES6" SETEMS+ESRSEMS5MS + ESRS42-1033AAA + 13FAA100000000000115000 ASE1   ########500000000000000    PRODUCT
20192020TCRASTDSUBMERSIBLES6" SETEMS+ESRSEMS5MS + ESRS36-1233AAA + 13FAA100000000000115000 ASE1   ########500000000000000    PRODUCT
20182019TCRBSTDSUBMERSIBLES6" SETST+RS-SST075D + RS31SS/3031AAA + 21FAA100000000000115000 ASE1   ########1000000000000000    PRODUCT
20172018TCRASTDSPARESSPARESSPARESIMPELLER HCS725H / ASMSP725H (SS) (SP)00000000500051900 ASE2   ######## 00000000000000    SPARES
20172018TCRASTDSPARESSPARESSPARESIMP+DIFF ASSY JRF06 (SPS)0000000045000452000 ASE4   ######## 00000000000000    SPARES
20172018TCRBSTDSPARESSPARESSPARESIMP+DIFF ASSY JRF09 (SPS)0000000045000452100 ASE4   ######## 00000000000000    SPARES
20182019TCRBSTDSPARESSPARESSPARESDIFFUSER HOUSING RS30/35/40 (SPS)0000000012000122300 ASE1   ######## 00000000000000    SPARES
20182019TCRBSTDSPARESSPARESSPARESPAN HEAD SCREW MS M5 X 16 MM (SP)000000001000001002400 ASE2   ######## 00000000000000    SPARES

Hi @srkase ,

 

I have already seen your data, but I still don't understand which column you want to put in “Rows”. At the same time, I found that Total CR has two or more values of a year, maybe you need to sum it by years.

Best Regards,

Eads

 

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

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

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.