Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Zerozinho
New Member

How to obtain a return series?

  1. Hey all,

 

I'm facing the following problem and I'm having trouble solving it. Given the following table

 

DateBenchmarkDesired Column
03/02/20211197251,0126
02/02/20211182341,0074
01/02/20211173651,0117
29/01/20211160070,9900
28/01/20211171720,9892
27/01/20211184430,9894
26/01/20211197080,9920
22/01/20211206731,0014
21/01/20211205021

 

I want to calculate the "Desired Column" that is reached by dividing the N day by N-1 day. So for example, for the date 03/02/2021 the math would be 119725/118234 = 1,0126. Is there any DAX formula that could work in this problem? I have tried some combinations of formulas but no success. Thanks in advance

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

Here is a measure expression you can use in a table visual with your date and benchmark columns.

 

NewMeasure =
VAR vThisDate =
    MIN ( Benchmark[Date] )
VAR vPrevDate =
    CALCULATE (
        MAX ( Benchmark[Date] ),
        ALL ( Benchmark[Date] ),
        Benchmark[Date] < vThisDate
    )
VAR vThisBenchmark =
    SUM ( Benchmark[Benchmark] )
VAR vPrevBenchmark =
    CALCULATE (
        SUM ( Benchmark[Benchmark] ),
        ALL ( Benchmark[Date] ),
        Benchmark[Date] = vPrevDate
    )
VAR vDenominator =
    IF (
        ISBLANK ( vPrevBenchmark ),
        vThisBenchmark,
        vPrevBenchmark
    )
RETURN
    DIVIDE (
        vThisBenchmark,
        vDenominator
    )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)