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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Switch in modified date

I have this list:

Arielle914_0-1600763677426.png

This table is about testing. When a test is one, it is good. When it is two, it is bad. Every month there will come a new value for some rows (not every row). It depends on when it is tested. I want to count the total of good tested rows. Therefor it needs to find the last number in de row. If it is a one, then the whole row gets the value one in my calculation. If it has a one in july and later in august a two, then it needs to get a two. But if in september it will be good again it needs to switch to the one again and ignore the two. And so on for every month. 

 

I now have:

Arielle914_1-1600764150207.png

Row 5 : a list of total tested distinct items in all the months

Row 6 + 7: filtered where the outcome is 1 or 3. This are good outcomes

Row 8: minus where the outcome is 2.

So I get in to trouble when there will be a 1 after the value of 2. It will count it double. I don't want that. The 1 AFTER a 2 or a 3 AFTER a 2 needs to be superior.

 

Can somebody help me?

 

 

1 REPLY 1
lbendlin
Super User
Super User

I think you have bigger problems.  Your data structure is not sustainable. You will want to unpivot your data and bring it into a form like 

 

Item | Date | Result

 

Then it is trivial to use TOPN(1) or MAX() to find the latest result for each item.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.