Forum Discussion

New_hello188's avatar
New_hello188
Icon for Helper I rankHelper I
2 years ago
Solved

Retrieve data from the previous quarters using a QQ-YYYY formatted column.

Hello Community Members,   I'm reaching out for your help and advice. I need to retrieve data from the previous quarter and the two quarters before that, based on a QQ-YYYY formatted column.   He...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi New_hello188 ,

    Please refer to my pbix file.

    If you want to put last quarter's value into card, this measure you wrote won't work because it's getting value based on each [promise date] in the table and can't be put into card visual, you can create a measure.

    Measure = 
    VAR _cur_year_quarter = CALCULATE(MAX('Date Table'[YearQuarterSort]),'Date Table'[Date]=TODAY())
    VAR _result = CALCULATE(SUM('Table1'[Amount]),'Date Table'[YearQuarterSort]=_cur_year_quarter-1)
    RETURN
    _result

    Best Regards
    Community Support Team _ Rongtie

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