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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
justlearning
New Member

Calculated Column Memory Issue

I am trying to compare a previous row value with the next row and use that criteria to highlight any changes in a table. The expression below pulls the last value with the same attribute name and same line number. The dataset has approx 215000 records. The expression below was working fine with a smaller dataset, but as it has grown, it has now stopped working due to not enough memory. I'm hoping someone can suggest ways to simplify the expression of the calculated column. 

 

1. "Allow data previews to download in the background" is unselected. 

2. I have increased the Data Cache Management Options Max Allowed (MB) to 25000

 

 

PreviousValue =

Var PreviousRow =
    TOPN(
            1,
            filter(
                LineSetup_Modified,
                     LineSetup_Modified[DateTime] < EARLIER(LineSetup_Modified[DateTime])
                        && (LineSetup_Modified[Attribute] = EARLIER(LineSetup_Modified[Attribute]))
                         && (LineSetup_Modified[Line] = Earlier(LineSetup_Modified[Line]))
       
            ),
             LineSetup_Modified[DateTime],
             DESC
        )
VAR PreviousValue = Minx(PreviousRow, LineSetup_Modified[Value])

RETURN PreviousValue

 

2 REPLIES 2
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @justlearning 

I think this should be possible without TOPN. Can you maybe provide a sample dataset with relevant columns?

 

Best regards

Michael

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

I am unable to attach a csv or any exported data from the file so below is a preview of how the table looks. I believe I have every variable from 2 different timestamps. 

DateTimeDateTimeKeyIndexLineMachineAttributeValuePreviousValue
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648602114428S1S1_Bl1.2876961.428329
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648602114408S1S1_BP3660
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648602114438S1S1_Co1.6758961.845162
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648602114448S1S1_Ex0.20.3
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648602114458S1S1_Ex26.324.1
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648602114488S1S1_Ov132.914222.27851
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648612114776S1S1_Bl1.7975831.797583
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648612114746S1S1_BP72367211
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648612114786S1S1_Co2.0184172.018417
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648612114796S1S1_Ex0.20.2
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648612114806S1S1_Ex25.524.4
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648612114836S1S1_Ov139.0545139.5428
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648622115047S1S1_Bl1.1900581.180065
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648622115017S1S1_BP2203822044
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648622115057S1S1_Co1.6058811.555853
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648622115067S1S1_Ex0.250.25
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648622115077S1S1_Ex30.828.9
12/14/2022 0:001899-12-30 14:56:5812/14/2022 14:5648622115107S1S1_Ov182.2688184.1243
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112896A1A1_Pr00
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112906A1A1_Pr350350
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112696S1S1_Bl1.7975831.787583
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112666S1S1_BP72117223
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112706S1S1_Co2.0184172.018417
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112716S1S1_Ex0.20.2
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112726S1S1_Ex24.423.1
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438602112756S1S1_Ov139.5428123.6244
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113477A1A1_Pr00
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113487A1A1_Pr280280
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113277S1S1_Bl1.1800651.180065
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113247S1S1_BP2204422063
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113287S1S1_Co1.5558531.555853
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113297S1S1_Ex0.250.25
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113307S1S1_Ex28.926.4
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438612113337S1S1_Ov184.1243176.043
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113998A1A1_Pr00
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622114008A1A1_Pr100100
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113838S1S1_Bl1.4283291.428329
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113808S1S1_BP018974
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113848S1S1_Co1.8451621.845162
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113858S1S1_Ex0.30.3
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113868S1S1_Ex24.124.8
12/14/2022 0:001899-12-30 10:04:0312/14/2022 10:0438622113898S1S1_Ov22.2785174.35529

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors