cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Calculated Column based on a condition

Hi, 

I have the following table with datetime and level. And what I want is to create a calculated column, which starts with 1 and increases every time when level=999. Looks simple to do. But I couldnt do it using DAX. Btw I want to create it with DAX and not with M. 

zatu_0-1596106930926.png

Best regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Calculated Column based on a condition

@zatu , Try a new column like

countx(filter(table,[date time]<= earlier[date time] && [Level] ="999"),[Level] )



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Calculated Column based on a condition

@zatu , Try a new column like

countx(filter(table,[date time]<= earlier[date time] && [Level] ="999"),[Level] )



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: Calculated Column based on a condition

Hi @zatu 

amitchandak's formula is useful despite of a little grammar error.

Capture11.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors