cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mathissimus Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Earlier is not 0

HI @Mathissimus ,

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 Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Earlier is not 0

HI @Mathissimus ,

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 Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Highlighted
Mathissimus Frequent Visitor
Frequent Visitor

Re: Earlier is not 0

Many thanks!!!

 

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)