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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
ChubbChubb
Helper I
Helper I

Previous Data Collection

I'm trying to get the previous report data to appear next to current report data but can't get it to work.

 

There is a filter on the page to pick a particular data point and I want to show if it has gone up or down since the last data point. I have created sequential numbers for each data point, but in some cases students may skip one of these data points. This is the DAX I have created but it keeps returning 0%, where am I going wrong?

 

Previous % 9-4 =
VAR CurrentDC = SELECTEDVALUE('CLASS ASSESSMENT'[Period Sequential Number])
VAR PreviousDC = CurrentDC - 1
RETURN
CALCULATE('CLASS ASSESSMENT'[% 9-4],'CLASS ASSESSMENT'[Period Sequential Number] = PreviousDC)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ChubbChubb ,

 

A separate filter table needs to be created for the Period Sequential Number field. Then modify the formula as above, refer below:

Slicer = VALUES('Table'[Period Sequential Number])

vkongfanfmsft_0-1716428836639.png

Previous % 9-4 = 
VAR CurrentDC =
    SELECTEDVALUE (Slicer[Period Sequential Number])
VAR PreviousDC = CurrentDC - 1
RETURN
    CALCULATE (
        MAX('Table'[% 9-4]),
        'Table'[Period Sequential Number] = PreviousDC
    )

vkongfanfmsft_1-1716428878013.png

Best Regards,
Adamk Kong

 

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

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ChubbChubb ,

 

A separate filter table needs to be created for the Period Sequential Number field. Then modify the formula as above, refer below:

Slicer = VALUES('Table'[Period Sequential Number])

vkongfanfmsft_0-1716428836639.png

Previous % 9-4 = 
VAR CurrentDC =
    SELECTEDVALUE (Slicer[Period Sequential Number])
VAR PreviousDC = CurrentDC - 1
RETURN
    CALCULATE (
        MAX('Table'[% 9-4]),
        'Table'[Period Sequential Number] = PreviousDC
    )

vkongfanfmsft_1-1716428878013.png

Best Regards,
Adamk Kong

 

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

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.