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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Add new column in Matrix visual with up or down arrow (comparison with previous month)

Hello Everyone,

Greetings,

 

i have created below matrix visual with with Year and month in column Region in rows 

 

abhilash_patel_0-1628913477697.png

 

i have to add new column after each month and which give the comparision of current month values with previous month values as shown below.

 

Green down Arrow  abhilash_patel_2-1628913900189.png - Indicates Current month values is less compared to previous month

Yellow line abhilash_patel_3-1628913976257.png- Indicates current month  values  are to previous month

Red Up Arrow abhilash_patel_4-1628914025798.png-  Indicates Current month values is less compared to previous month

 

abhilash_patel_1-1628913705130.png

 

 

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Hope you have a dates table in your model and it is connected to your fact table. I used the Power BI sample data and created the expected results. The file is attached below my signature. 
You need to create a measure to evaluate the status and assign it to the CF logic.

Fowmy_0-1629037109562.pngFowmy_1-1629037125370.png

DAX Formula to get the logic: 

Growth = 
VAR __SALES = [Total Sales]
VAR __PM = 
    CALCULATE(
        [Total Sales],
        DATEADD( Dates[Date] , -1 , MONTH )
    )
    RETURN
IF(
    NOT( ISEMPTY(financials) ) && __PM <> BLANK() && HASONEVALUE(Dates[Year Month No]),
    SWITCH(
        TRUE(),
        __SALES  > __PM ,1,
        __SALES  = __PM, 0,
        __SALES < __PM,-1
    )
)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

Hope you have a dates table in your model and it is connected to your fact table. I used the Power BI sample data and created the expected results. The file is attached below my signature. 
You need to create a measure to evaluate the status and assign it to the CF logic.

Fowmy_0-1629037109562.pngFowmy_1-1629037125370.png

DAX Formula to get the logic: 

Growth = 
VAR __SALES = [Total Sales]
VAR __PM = 
    CALCULATE(
        [Total Sales],
        DATEADD( Dates[Date] , -1 , MONTH )
    )
    RETURN
IF(
    NOT( ISEMPTY(financials) ) && __PM <> BLANK() && HASONEVALUE(Dates[Year Month No]),
    SWITCH(
        TRUE(),
        __SALES  > __PM ,1,
        __SALES  = __PM, 0,
        __SALES < __PM,-1
    )
)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy Thanks the solution it is working for me 

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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.