Forum Discussion

kirkademidov's avatar
kirkademidov
Frequent Visitor
8 years ago

ParallelPeriod for Half Year (Semester) in DAX

Hi all, 

 

I need to create some measure with calculation for value in previous period. 

I have two cases: Previous Quarter and Previous Half Year. 

 

In first case I'm using simple function: CALCULATE([SomeValue],PARALLELPERIOD(SurveyDate[Date],-1,QUARTER))

But how I can do it with semester? on ParallePeriod I can use only YEAR, QUARTER and MONTH. 

I can not use PARALLELPERIOD(SurveyDate[Date],-2,QUARTER because it still will work on quarter level and will bring me calculation for quarter level and not for half year. 

 

My Date Hierarchy looks like Month-Quarter-Half Year - Year

 

I`m sure that such kind of business question is quite common so I`m sure that there is some workaround for it. 

 

Thanks a lot!

2 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Resident Rockstar

    kirkademidov,

     

    How did you define [Half Year] in your table? Are you using a Calendar table or are you using the fact table date column?

     

    What if you had [Half Year Key] that you could base your calculation off of instead of PARALLELPERIOD.

     

    For example, something like:
    CALCULATE ( [SomeValue], 'tablename'[Half Year Key you're trying to get] )

     

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi kirkademidov,

     

    It would be better you could provide some dummy data. Especially, please show us what is "Half Year"?

     

    Regards,

    Yuliana Gu