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

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

3 REPLIES 3
amitchandak
Super User
Super User

Please find solution

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
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.

Top Solution Authors