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

Earlier is not 0

Is it possible using earlier with something like "not null" instead of using -1 or -2 etc.

I dont want that it writes just the data wich is in the previous field , but I want that it writes the first previous data wich is not 0 for example.

 

My Formula should be something like this, but it doesnt work, cause I can`t reference to its own ("Downtime"

 

Downtime = IF('runtime nagios_statehistory (2)'[eventtype]=2;2; IF('runtime nagios_statehistory (2)'[eventtype]=3;3; (CALCULATE(MAX('runtime nagios_statehistory (2)'[Downtime]);FILTER('runtime nagios_statehistory (2)';'runtime nagios_statehistory (2)'[object_id]=EARLIER('runtime nagios_statehistory (2)'[object_id])&&'runtime nagios_statehistory (2)'[Group Ranke]=EARLIER('runtime nagios_statehistory (2)'[Group Ranke]) -1)))))

 

Someone has an idea?

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

AFAIK, current power bi does not support add DAX formula and invokes its previous result for calculating. I'd like to suggest you split this formula to multiple columns to do formatting on 'Type' value.

 

TypeGroup =
IF (
    'Table'[eventtype] IN { 2,3 };
    'Table'[eventtype]
)
	
Downtime =
IF (
    'Table'[TypeGroup] <> BLANK ();
    'Table'[TypeGroup];
    CALCULATE (
        MAX ( 'Table'[TypeGroup] );
        FILTER (
            'Table';
            'Table'[object_id] = EARLIER ( 'Table'[object_id] )
                && 'Table'[Group Ranke]
                    = EARLIER ( 'Table'[Group Ranke] ) - 1
        )
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

AFAIK, current power bi does not support add DAX formula and invokes its previous result for calculating. I'd like to suggest you split this formula to multiple columns to do formatting on 'Type' value.

 

TypeGroup =
IF (
    'Table'[eventtype] IN { 2,3 };
    'Table'[eventtype]
)
	
Downtime =
IF (
    'Table'[TypeGroup] <> BLANK ();
    'Table'[TypeGroup];
    CALCULATE (
        MAX ( 'Table'[TypeGroup] );
        FILTER (
            'Table';
            'Table'[object_id] = EARLIER ( 'Table'[object_id] )
                && 'Table'[Group Ranke]
                    = EARLIER ( 'Table'[Group Ranke] ) - 1
        )
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Many thanks!!!

 

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.