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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Asim
Helper I
Helper I

Calculated column to measure

Good Morning,

Is it possible to change below mentioned calculated column to measure as this calculated column consume alot of memory and when my table rows reach to 20k then i got not enough memory error.

Is there anyone who can help please.

 

Regards

Asim

 

Setup Count =
VAR PreviousDate =
CALCULATE (
MAX ( EventLog[Date] ),
FILTER (
ALLEXCEPT ( EventLog, EventLog[Machine] ),
EventLog[Event] = "setup"
&& EventLog[Date] < EARLIER ( EventLog[Date] )
)
)
VAR PreviousMaterial =
CALCULATE (
FIRSTNONBLANK ( EventLog[Semi.Mat.No.], 1 ),
FILTER (
ALLEXCEPT ( EventLog, EventLog[Machine] ),
EventLog[Event] = "setup"
&& EventLog[Date] = PreviousDate
)
)
RETURN
IF ( EventLog[Semi.Mat.No.] = PreviousMaterial, BLANK(), 1 )

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Asim,

Have you resolved your issue? If you have, please mark the reply as answer if you think it's useful. More people will learn new things here.  If you haven't, please feel free to ask.

Thanks

Zubair_Muhammad
Community Champion
Community Champion

Hi @Asim

 

Try this as  a MEASURE

 

Setup Count =
VAR PreviousDate =
    CALCULATE (
        MAX ( EventLog[Date] ),
        FILTER (
            ALLEXCEPT ( EventLog, EventLog[Machine] ),
            EventLog[Event] = "setup"
                && EventLog[Date] < SELECTEDVALUE ( EventLog[Date] )
        )
    )
VAR PreviousMaterial =
    CALCULATE (
        FIRSTNONBLANK ( EventLog[Semi.Mat.No.], 1 ),
        FILTER (
            ALLEXCEPT ( EventLog, EventLog[Machine] ),
            EventLog[Event] = "setup"
                && EventLog[Date] = PreviousDate
        )
    )
RETURN
    IF ( SELECTEDVALUE ( EventLog[Semi.Mat.No.] ) = PreviousMaterial, BLANK (), 1 )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI 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.

Top Solution Authors
Top Kudoed Authors