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

A problem for create YoY year change

I use quick measure to create a Yoy change% as below. (with a filter Month= Dec)

 

You can see it drops to -100% in 2019 -- becasue there is no data for 2019 -- is there a way to hide this -100%? 

 

Capture.JPG

 

 

Data set looks like this: (It's by year by month but in 2019, the data is only up to July while my chart has a filter =December)

 

Year             Month

2018            Jan

..

..

..

2018           Dec

2019           Jan

...

2019            July

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

Hi @baron33,

Maybe you can try to pack this measure with if statement to check if current date existed records, return measure result or blank based on if statement.

Measure =
IF (
    CALCULATE (
        SUM ( Table[Amount] ),
        ALLSELECTED ( Table ),
        VALUES ( Calendar[date] )
    ) > 0,
    [YOY measure],
    BLANK ()
)

If this not help, please share some dummy data to test.

How to Get Your Question Answered Quickly 

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

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @baron33,

Maybe you can try to pack this measure with if statement to check if current date existed records, return measure result or blank based on if statement.

Measure =
IF (
    CALCULATE (
        SUM ( Table[Amount] ),
        ALLSELECTED ( Table ),
        VALUES ( Calendar[date] )
    ) > 0,
    [YOY measure],
    BLANK ()
)

If this not help, please share some dummy data to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

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

@baron33 , Try like

YOY % = if([This Year]=0 || isblank([This Year]),blank(), divide([This Year]-[Last Year],[Last Year]))

 

This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

Greg_Deckler
Super User
Super User

Filter for > -99?

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.