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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Optimize DAX memory

Im currenly having an issue with VAR data. When i try to run this with all that dax measurements i run out of memory. As you can see i only have 7 measurments in this because i couldnt figure out which measurement was causing me the issue. Unfortunately, its this one. Does anyone know of a diffrent way of attiving this? basically i want to subtract the previous dimension with the current dimension. these are based on time stamps. so in excell it would be =ABS ( A2-A3). Something like that but because power bi is not set up like this i had to make another equation basically to get the dates in order (which is the second picture). I cant imagine this is that big for power bi which leads me to believe that its how i wrote the DAX measurment.

 

Any help would be appreciated Capture.PNGCapture1.PNG

5 REPLIES 5
Greg_Deckler
Super User
Super User

Sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Unfortunately, I cant post the actually data due to privacy issues nor can i give you the actual file that im working with.  I undertand how that would make it eaiser to answer my question. Apologize for the little information to go off of.

Anonymous
Not applicable

Could you clearly explain what you are trying to do in this measure? I'd like to know, for instance, why you are using ALLSELECTED and why there is no Date/Calendar table in your design.

Also, please go to www.daxformatter.com and format the measure properly so that people can read it.

Thanks.

Best
D
Anonymous
Not applicable

Moving Range =
IF (
    ISBLANK ( 'eOVL Data - MySQL'[Earlier Time1] ),
    BLANK (),
    (
        VAR EarlierTime =
            CALCULATE (
                MAX ( 'eOVL Data - MySQL'[TimeStamp] ),
                FILTER (
                    ALLSELECTED ( 'eOVL Data - MySQL'[TimeStamp] ),
                    'eOVL Data - MySQL'[TimeStamp]
                        < SELECTEDVALUE ( 'eOVL Data - MySQL'[TimeStamp] )
                )
            )
        VAR EarlierMeasureValue =
            CALCULATE (
                SUM ( 'eOVL Data - MySQL'[Measured Value] ),
                'eOVL Data - MySQL'[TimeStamp] = EarlierTime
            )
        RETURN
            ABS ( EarlierMeasureValue - SUM ( 'eOVL Data - MySQL'[Measured Value] ) )
    )
)

 

This should now be a proper dax equation. All selected is becasue i have slicers that need to be used. I know this will slow down Power bi also but i need the. Basically there is thousands of part numbers that this is looking through and the time in which they were measured. Its let putting them in order from oldest to newest. Its then getting the diffrence between measurments. If your familiar with stats, its a moving range chart. The equations that i use work when the data that is pulled isnt huge but when I pull from our SQL database instead of an excel workbook it takes 20 min.

Anonymous
Not applicable

Oh, and there is a date table you just couldnt see it in the Snip-it that was sent.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors