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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
PomJack
Frequent Visitor

Help creating a column that determines whether or not a row is displayed after counter reset

Hi Power BI Community,

 

I've been struggling with this problem for a while and have not found a work around for it yet. I am working with the table below and I would only like to display certain rows in the visuals. I only want to display the rows after the most recent error count "reset". I haven't found a way to create the display column yet or filter the visual to ignore the rows before the error count "reset". 

 

Die HitsTime StampIndexError CountDisplay? - Create this column
20571/8/20255474y
7871/7/20255433y
3531/6/20255232y
3511/6/20255211y
5596311/16/20241278n
5587011/14/20241237n
5584811/14/20241226n
5584611/14/20241215n
5584111/14/20241204n
5369011/10/2024913n
5344211/7/2024602n
5309411/6/2024551n

 

The table is just a snippet of the full table. It is possible for there to be multiple error count "resets" and I only want the most recent reset displayed. 

 

Thanks for your help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from lbendlin.

 

Hi @PomJack,

 

As lbendlin said, we can create a measure and here are the steps to do so:

1. Create a measure:

 

Display = 
VAR _date=CALCULATE(MAX('Table'[Time Stamp]),FILTER(ALL('Table'),'Table'[Error Count]=1))
RETURN
IF(MAX('Table'[Time Stamp])>=_date,"y","n")

 

 

2. Filter the data with the measure value of y:

vlinhuizhmsft_0-1739773109674.png

3. Result:

vlinhuizhmsft_1-1739773209207.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

So you want all the rows after the latest date that has an Error Count of 1 (including that row) ?

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZZDJDcQgDAB74R0J34ZaUPpvYzkdaflY4BnLR2uJQD09CXPJBKT9qTISkt6nJS8L+ge5R56QlSe0gDQStCH+w5mYULXarMWMU5DxodGrbKE4bEE+YdT4EaTcAvVoIdgtjBk0BLwFiN2VrZ4Z4AgVY31lEVrcDzaIAyhDlYVjRdV1gvcH", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Die Hits" = _t, #"Time Stamp" = _t, Index = _t, #"Error Count" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Time Stamp", type date}, {"Error Count", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Time Stamp] >= List.Max(Table.SelectRows(#"Changed Type", each [Error Count]=1)[Time Stamp]))
in
    #"Filtered Rows"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.

Yes, that is one way of framing the problem.

I added the sample code.

The table in this question is already in table view in Power BI. The Error Count column is a new calculated column in the table view. Is there a way to do the same thing as above, but in table view instead of power query? I should have included these details in the original post.

Anonymous
Not applicable

Thanks for the reply from lbendlin.

 

Hi @PomJack,

 

As lbendlin said, we can create a measure and here are the steps to do so:

1. Create a measure:

 

Display = 
VAR _date=CALCULATE(MAX('Table'[Time Stamp]),FILTER(ALL('Table'),'Table'[Error Count]=1))
RETURN
IF(MAX('Table'[Time Stamp])>=_date,"y","n")

 

 

2. Filter the data with the measure value of y:

vlinhuizhmsft_0-1739773109674.png

3. Result:

vlinhuizhmsft_1-1739773209207.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

The logic is the same.  Create a measure to find the newest Date that has an error count of 1, then filter to show that data and any newer dates.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.