cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Mathissimus Frequent Visitor
Frequent Visitor

Re: Earlier is not 0

Many thanks!!!

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 485 members 4,551 guests
Please welcome our newest community members: