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

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

Reply
StuartSmith
Power Participant
Power Participant

Correct Row Count ( Example file attached)

I have a table visual that is made up of various columns (measures) and there is also a visual filter...

 

Closed before =
Sumx(values('Master Lookup Table'[Buidling Code]),
IF([Location Status] = "Archived" && [Date Closed] < [1) First Period Date] , 1,
0))
StuartSmith_2-1702292644415.png

 

The above visual filter, filters the table rows depending on if the "Loction Status" is "Archived" and the "Date Closed" is before the "First Period Date" which is a Slicer filtering a date table.  I now need to be able to count the rows of the table visual.  I can do "Countrows", which does count the rows, but doesnt take into account the above Visual Filter when a date is selected.
StuartSmith_4-1702294094032.pngStuartSmith_5-1702294109644.png

CountAttritionRows.pbix 

How can it get a correct row count figure? Hope that makes sense.

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @StuartSmith ,

 

Please update your measure.

Count Rows = 
VAR AllRows = COUNTROWS(FILTER(ALLSELECTED('Master Lookup Table'),[Closed before]=0))
Return
AllRows

vtangjiemsft_0-1702538118473.png

Best Regards,

Neeko Tang

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @StuartSmith ,

 

Please update your measure.

Count Rows = 
VAR AllRows = COUNTROWS(FILTER(ALLSELECTED('Master Lookup Table'),[Closed before]=0))
Return
AllRows

vtangjiemsft_0-1702538118473.png

Best Regards,

Neeko Tang

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

StuartSmith
Power Participant
Power Participant

Thanks guys, I will take a look, although not familiar with ADDcOLUMN & SUMMERISE, so will take a look.  

HotChilli
Super User
Super User

Hi @StuartSmith ,

referring to your original question: To count the rows in the visual you will have to create a measure - using ADDCOLUMNS(SUMMARIZE(   - to create a virtual tablewhich is the same as the visual table and then count the rows of that table.

All the same fields from the visual will have to be included in the virtual table and then the correct filtering applied to mimic the table visual.

I advise testing with a simplified version of your table to start with, for example, the fields from the visual plus one measure, and if you can get that to work, build it up.

 

StuartSmith
Power Participant
Power Participant

Unsure how I can change the report so it filters "Archvied" sites that are closed before the date slicer selection without using...

 

Closed before =
Sumx(values('Master Lookup Table'[Buidling Code]),
IF([Location Status] = "Archived" && [Date Closed] < [1) First Period Date] , 1,
0))
Bibiano_Geraldo
Super User
Super User

Hi, i was checking your project, you need to remodel it, you are changing the filter but you're still seing the same thing.
But now asking your question, your problem its because the 'Master Lookup table' its not related with 'Date Table',  so to be able to filter values using date your need to relate these tables mentioned above.
Look the experiment bellow, when you click into matrix the controws its working normally.

ezgif-5-4b750360b1.gif

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors