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
themistoklis
Community Champion
Community Champion

Matrix - YoY percentage is displayed only on a few values

Hello All,

 

I have the following Matrix on PowerBI and when i use the formula for the YoY calculation i get blank for "Cancelled" and "Lost" although there are numbers in both cells for 2018 YTD and 2017 YTD. I get the percentage for the first 'Status' value only.

 

Capture.JPG

 

The formula im using is the following:

YoY % Diff = DIVIDE(([NetValue_YTD_TY_Quo] - [NetValue_YTD_PY_QuoWon]), [NetValue_YTD_PY_QuoWon])
NetValue_YTD_TY_Quo = 
IF (
    MIN ( 'Calendar'[Date] ) <= CALCULATE ( MAX ( 'Master Table'[Reference_Date]), ALL ( 'Master Table' ) ),
    CALCULATE ( SUM(Quotations[Net_Value_Quo]), DATESYTD ( 'Calendar'[Date] ) )
)

 

NetValue_YTD_PY_Quo = VAR DataMaxDate =
    CALCULATE ( MAX ( 'Quotations'[Reference_Date] ), ALL ( 'Quotations' ) )
RETURN
    CALCULATE (
        [NetValue_YTD_TY_Quo],
        SAMEPERIODLASTYEAR (
            INTERSECT (
                VALUES ( 'Calendar'[Date] ),
                DATESBETWEEN ( 'Calendar'[Date], BLANK (), DataMaxDate )
            )
        )
    )

 

Any idea why im getting only the percentage difference for a few "Status" values?

 

Thanks

 

 

1 ACCEPTED SOLUTION

@Ashish_Mathur

Ashish thank you for the reply. Your formulas are more compact and more readable but i still got the samem proble with the YoY % diff.

 

I found out that the following formula did the trick:

 

YoY % Diff = DIVIDE((IF(ISBLANK([NetValue_YTD_TY_Quo]),0,[NetValue_YTD_TY_Quo]) - IF(ISBLANK([NetValue_YTD_PY_Quo]),0,[NetValue_YTD_PY_Quo])),IF(ISBLANK([NetValue_YTD_PY_Quo]),0,[NetValue_YTD_PY_Quo]))

 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

I'm not sure but try these simplified measures

 

NetValue_YTD_TY_Quo = CALCULATE(SUM(Quotations[Net_Value_Quo]), DATESYTD('Calendar'[Date]))

NetValue_YTD_PY_Quo = CALCULATE([NetValue_YTD_TY_Quo], SAMEPERIODLASTYEAR('Calendar'[Date]))

YoY % Diff = DIVIDE(([NetValue_YTD_TY_Quo] - [NetValue_YTD_PY_QuoWon]), [NetValue_YTD_PY_QuoWon])

 

Ensure that you select a specific month in the slicer/filter

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur

Ashish thank you for the reply. Your formulas are more compact and more readable but i still got the samem proble with the YoY % diff.

 

I found out that the following formula did the trick:

 

YoY % Diff = DIVIDE((IF(ISBLANK([NetValue_YTD_TY_Quo]),0,[NetValue_YTD_TY_Quo]) - IF(ISBLANK([NetValue_YTD_PY_Quo]),0,[NetValue_YTD_PY_Quo])),IF(ISBLANK([NetValue_YTD_PY_Quo]),0,[NetValue_YTD_PY_Quo]))

 

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