Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Creating variance vs. prior period without Date Table?

Hello, due to the structure of my org's fiscal calendar, I'm unable to use a date table to calculate Quarter-over-quarter variance.   Can I more easily create a variance measure if I have a prior q...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , Anonymous 

    Here are the steps you can refer to :

    (1)This is my test data :

    (2)We can click "New Column" to create a calculated column to sort in the visual :

    Sort_Falg = var _curent_q= CONVERT( RIGHT('Table'[Prior QTR],4) & MID('Table'[Prior QTR],2,1) ,INTEGER)
    return
    _curent_q

    (3)We can create a measure :

    Prior QTR Value = var _prior_qtr =SELECTEDVALUE('Table'[Prior QTR])
    var _t= FILTER( ALLSELECTED('Table'), 'Table'[Current QTR] = _prior_qtr)
    return
    SUMX(_t,[Current QTR Value])

    (4)Then we can put the filed we need on the visual ,and we can sort the [Current QTR] by the column [Sort_Falg] we create , then wen can meet your need , the result is as follows:

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly