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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Ignoring a specific row when a condition is met in a table.

Hello all. I am trying to solve what seems to be a difficult problem in DAX.

 

Below is the schema for the table that I am working within:

 

TableSchema.PNG

 

What I am attempting to do is capture when the status of a material changes from 0 to 1. 

 

In an attempt to do so, I have created a calculated column that uses the DAX function of EARLIER( ) and this does the job except that the column captures all 0s preceding the status change. Please see the example below.

 

CalcCol.PNG

 

Note that the desired outcome is for the first row of the table under the "Stat Switch" column to be blank instead of containing a value of 0 because another entry (after the first record) is where the Switch / status change actually occurrs.

 

Any tips on how to achieve this result would be greatly appreciated! 

 

Here is the link to the .pbix file 

 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Please find solution

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Please find solution

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

This solution worked! Thank you! Is there any to alter the logic so that if two records hold the same material and date and also have a status of "0", then one of those records would not be included in the calculated column?

 

Thanks again!

 

Anonymous
Not applicable

Please see the screenshot below for the specific exampleRepeatedDateExample.PNG

 Note that the intention is to either mark the first or the second row in the table above as 1 in "Column 2", not both.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors