Forum Discussion

cheid1977's avatar
cheid1977
Advocate I
9 years ago

YOY% DAX Formula

I have created a formula that calculates YOY %.  It does so correctly, but when I select the prior year in the slicer the visual goes blank and shows "Something's wrong with one or more fields".  To get to the YOY I have to use the SAMEPERIODLASTYEAR date fucntion.  Could this function be the problem?  What is the best way to eliminate this from happening? 

1 Reply

  • I had to use a date table, and used columns from my date table in the slicers (i.e. Year)

    For my measures, I calculated as follows:

    Facts = CALCULATE(SUM (FACT_TABLE[Fact]))
    Facts LY = CALCULATE([Facts],SAMEPERIODLASTYEAR(DateTable[Date]))
    Facts YoY Var = [Facts] - [Facts LY]
    Facts YoY % Change = DIVIDE([Facts YoY Var],[Facts LY])

     

    Without seeing your measure definitions and example data, its hard to surmise what the issue is, but hope the above helps