Skip to main content
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.

Frequent Visitor

new measure of the same row values ​​with filters applied


I have a question.

I have two tables with excel connected by relations. Based on them, I created the table below in my report. The table contains all the information I need. Columns: Data, Index, Ba, in / out, Page number, material come from table 1. Column: Sh comes from table 2.


The report includes filters for: date, site number, material, and Sh. I'm having trouble creating a measure that will count the values ​​of in from the last row until it encounters the value of out. Out means the end of counting lines. Here, for my photo, the measure result should be 7.

Can it be solved with one measure?

Thank you in advance for your help.

Super User
Super User

@ewelinag17 Can you explain where the 7 is coming from? I can't figure out the logic to get 7. Is it the lines that are "in" and less than the Indeks of the "out"? If so, it should be something like:


Measure =
  VAR __Indeks = MAXX(FILTER('Table',[in/out]="out"),[Indeks])
  COUNTROWS(FILTER('Table',[Indeks]<__Indeks && [in/out]="in"))


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

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


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