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

Percent increase/decrease between 2 years only - 2021 vs 2022

Hi, please advise - I have used the below quick measure to calculate the % difference between billed quantity from 2021 to 2022, however there's another column popping up with 0.00% values. Please advise how to exclude this column from my table visual - Thanks!

 

2021 vs 2022 % =
VAR __BASELINE_VALUE =
    CALCULATE(
        SUM('Append1'[Billed Quantity]),
        'Calendar'[Date].[Year] IN { 2021 }
    )
VAR __MEASURE_VALUE = SUM('Append1'[Billed Quantity])
RETURN
    IF(
        NOT ISBLANK(__MEASURE_VALUE),
        DIVIDE(__MEASURE_VALUE - __BASELINE_VALUE, __BASELINE_VALUE)
    )
 
This is my current table visual per Product Category using the above measure:
 
Nicky_12345_0-1662904083610.png

 

1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @Nicky_12345 ,

 

The second column is displayed because of how your visual is built. It looks like you are using a matrix where your measures ("Billed Quantity" + "2021 vs 2022 %") are broken down by some kind of category (the first column on the left which is not shown in your picture) as well as date/year (column "2021" + "2022"). So both of your measures have a filter on year (Year = 2021 OR Year = 2022) which leads to 2 different columns per year. 

 

To solve this you could create two more measures:

Billed Quantity 2021=
    CALCULATE(
        SUM('Append1'[Billed Quantity]),
        'Calendar'[Date].[Year] IN { 2021 }
    )
 

 

Billed Quantity 2022=
    CALCULATE(
        SUM('Append1'[Billed Quantity]),
        'Calendar'[Date].[Year] IN { 2022 }
    )
 
Then use the three mesaures in your visual and do not drag in date/year.
 
Let me know if this helps 🙂
 


Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

3 REPLIES 3
Nicky_12345
Frequent Visitor

@tackytechtom Please advise how to create another measure for sum of sales for July 2022 and then another measure for August 2022. Thanks!

tackytechtom
Super User
Super User

Hi @Nicky_12345 ,

 

The second column is displayed because of how your visual is built. It looks like you are using a matrix where your measures ("Billed Quantity" + "2021 vs 2022 %") are broken down by some kind of category (the first column on the left which is not shown in your picture) as well as date/year (column "2021" + "2022"). So both of your measures have a filter on year (Year = 2021 OR Year = 2022) which leads to 2 different columns per year. 

 

To solve this you could create two more measures:

Billed Quantity 2021=
    CALCULATE(
        SUM('Append1'[Billed Quantity]),
        'Calendar'[Date].[Year] IN { 2021 }
    )
 

 

Billed Quantity 2022=
    CALCULATE(
        SUM('Append1'[Billed Quantity]),
        'Calendar'[Date].[Year] IN { 2022 }
    )
 
Then use the three mesaures in your visual and do not drag in date/year.
 
Let me know if this helps 🙂
 


Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hi tomfox,

 

Thank you so much, it works! 😄 

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
Top Kudoed Authors