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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
grasa
Helper I
Helper I

Show Diff PY just once

Dear all,

 

I would like to show a qty vs. previous year qty comparison. Therefore I already created a measure which calculates the % diff to last year. Do you have any idea how I could remove the yellow marked column? I would like to see the information on % diff only for year 2025.

 

grasa_0-1754905843686.png

 

grasa_1-1754905884658.png

 

Thank you very much in advance for your help.

 

1 ACCEPTED SOLUTION

@v-sdhruv Many thanks for your feedback! 

Now I put a white square over the text to hide the headline "Diff % LY" for 2024. Probably not the best solution but I couldn´t find another one 😉

Thanks again for all the help.

 

grasa_0-1757404048057.png

 

View solution in original post

17 REPLIES 17
v-sdhruv
Community Support
Community Support

Hi @grasa ,

Thanks for sharing the update! Glad it worked out for you.
If you have got a chance to try the suggestion above and it worked for you, kindly mark it as a solution else mark your response as a solution so that othe members can also benefit from it.

Thank You

sivarajan21
Post Prodigy
Post Prodigy

Hi @grasa ,

 

Method 1: Conditional Formatting with Blank Values

Modify your "Diff % LY" measure to return BLANK() for 2024:

Diff % LY = 
IF(
    YEAR(MAX('YourTable'[Date])) = 2024,
    BLANK(),
    [Your existing Diff % LY calculation]
)

If the above doesn't work, then please follow below:

Method 2: Using SELECTEDVALUE with Year Filter

If you're using a year slicer or filter, you can modify the measure:

Diff % LY = 
IF(
    SELECTEDVALUE('YourTable'[Jahr]) = 2024,
    BLANK(),
    [Your existing Diff % LY calculation]
)

Please try the above and let me know if you still face the issue

 

Best Regards,

Hi @sivarajan21 ,

Thank you very much for your reply.

Unfortunately both versions didn´t work, I still see the empty column for 2024.

 

Method 1:

grasa_0-1757489709175.png    

grasa_1-1757489755304.png

 

Method 2:

grasa_2-1757489788458.pnggrasa_3-1757489815805.png

I think the problem really is the matrix visual, as mentioned by v-sdhruv in the previous post. 

But thanks again for all the help.

 

v-sdhruv
Community Support
Community Support

Hi @grasa ,

Thanks for the update. I see what you are trying to achieve here.
Since it is a matrix visual you cant directly hide Diff % LY Modified which appears as a column.
In order to hide for 2024, You can try to go visual level filter-> Disable for Year 2024.
This will not show data for 2024.

Hope this helps!

@v-sdhruv Many thanks for your feedback! 

Now I put a white square over the text to hide the headline "Diff % LY" for 2024. Probably not the best solution but I couldn´t find another one 😉

Thanks again for all the help.

 

grasa_0-1757404048057.png

 

v-sdhruv
Community Support
Community Support

Hi @grasa ,

Thanks for sharing the details and screenshots. I’ve reviewed the measure and the visuals, but I’m not entirely sure why the 2024 column is still appearing despite the logic intended to filter it out.
Are there any filters or slicers applied that might be influencing the display?

Understanding this will help pinpoint whether the issue is with the measure logic or the visual configuration.


Thank You

Hi @v-sdhruv ,

Many thanks for your fast reply on this.

I don´t have any filters applied. 

 

grasa_0-1756279657354.png

 

Do you think it is because there are also vlaues for 2026 and 2027? Not for this quantity in my visual but for other fields in my data.

 

Thanks again 

v-sdhruv
Community Support
Community Support

Hi @grasa ,

Just wanted to check if you got a chance to review the suggestions provided and whether that helped you resolve your query?


Thank You

v-sdhruv
Community Support
Community Support

Hi @grasa ,

This might be because" January 2025 has no corresponding January 2024 data in your dataset." as earlier stated by @jaineshp 
As per the measure, it will show blank()  but you can modify the measure by using:

Diff % LY Modified =
IF (
    YEAR ( MAX ( 'DateTable'[Date] ) ) <> 2025,
    BLANK(),
    IF (
        ISBLANK ( [Gesamtmenge] ) || ISBLANK ( [LY Menge] ),
        BLANK(),
        DIVIDE ( [Gesamtmenge] - [LY Menge], [LY Menge] )
    )
)

This ensures the measure only returns values for 2025
Hope this helps!

Hi @v-sdhruv ,

Thank you very much for your reply and your suggestion. Unfortunately it does the same as the other ones. It shows blanks for the missing values but still shows up in the 2024 column. 

 

grasa_1-1756188231298.png

 

grasa_0-1756188177081.png

 

grasa
Helper I
Helper I

@FBergamaschi , @jaineshp Thank you very much for your fast reply on this. Unfortunately none of the new measures solved my problem.

 

grasa_0-1755077068909.png

 

grasa_1-1755077104563.png

grasa_2-1755077142009.png

 

Here is my measure for the Diff % LY calculation, maybe this helps:

grasa_3-1755077236349.png

Gesamtmenge = Total Qty

Menge = Qty

 

Thanks again and best regards,

Sarah

 

 

Hey @grasa,

Key Points:

  • The issue occurs because Januar 2025 has no corresponding Januar 2024 data in your dataset
  • Your original measure works fine when both current and previous year data exist
  • These solutions handle the missing previous year data scenario
  • Choose Option 1 if you want blanks, Option 2 for zeros, or Option 3 for custom text

Try this:

 

Diff % LY Modified =
IF(
ISBLANK([LY Menge]),
BLANK(),
DIVIDE([Gesamtmenge] - [LY Menge], [LY Menge])
)

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

@jaineshp 

Many thanks again! Indeed I have missing data, but for 2025.

 

grasa_0-1755078486022.png

If I use your measure but use "Gesamtmenge" instead of "LY Menge", the -100% for the missing data dissapears (that is also really nice to have, thanks 😊), but the empty Diff % LY column for 2024 still stays there.

 

grasa_1-1755078682778.png

grasa_3-1755078797985.png

 

 

Hey @grasa,

Diff % LY Modified =
IF(
ISBLANK([Gesamtmenge]) || ISBLANK([LY Menge]),
BLANK(),
DIVIDE([Gesamtmenge] - [LY Menge], [LY Menge])
)


Try this.

Hi @jaineshp ,

Many thanks for your help, unfortunately it is still showing the one for 2024.

 

grasa_2-1755157909073.png

 

 

grasa_0-1755151459510.png

 

FBergamaschi
Solution Sage
Solution Sage

create this measure and use it in place of the current one

 

CALCULATE ( 
           [Diff % LY],
           KEEPFILTERS(Date[year] = 2025)
)

 

Date[year] might have to be changed based on the name of your tables/columns

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

jaineshp
Memorable Member
Memorable Member

Hey @grasa,

Create a new version of your Diff % LY measure with conditional logic

 

Diff % LY Modified =
IF(
YEAR(MAX('DateTable'[Date])) = 2024,
BLANK(),
[Your existing Diff % LY measure]
)

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.