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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
hi5jimmy
New Member

Rowcount with Field Parameter

Hi Power BI Experts,

I am currently using below formula to count the row in table visual which is working fine. However, I want to use filed parameter to select columns dynamically in table visual could you help me how can I transform below formula. Result should display the rowcount no metter what combination user select in field parameter slicer. 

 

Table 1:

Column 1Column 2Column 3Column 4 (used for measure)
    

 

Measure 1 = Sum(Column 4)

 

Formula to calculate rowcount:

COUNTROWS(GROUPBY(Table 1, Table 1 [Column 1], Table 1 [Column 2], Table 1 [Column 3], "Name", sumx(currentgroup(), Table 1 [Measure 1])))

 

Thanks in advance.

5 REPLIES 5
devesh_gupta
Impactful Individual
Impactful Individual

@hi5jimmy Try if this measure works for you:

RowCountMeasure =
VAR SelectedColumns =
    VALUES('FieldParameterSlicer'[SelectedColumn])
VAR GroupedTable =
    SUMMARIZE(
        'Table 1',
        SelectedColumns,
        "RowCount", COUNTROWS('Table 1')
    )
RETURN
    COUNTROWS(GroupedTable)

 

If you find this insightful, please provide a Kudo and accept this as a solution.

Hi @devesh_gupta ,

This is resulting in total rowcount of table as below step gives all columns not selected ones.

VALUES('FieldParameterSlicer'[SelectedColumn])

 

Hi @devesh_gupta ,

Thanks for your inputs. however, Summarize function is not allowing me to use parameters in second argument. It says Summarize function expects a column name as argument number 2.

@hi5jimmy Okay, let's try like this:

 

RowCountMeasure =
VAR SelectedColumns =
    VALUES('FieldParameterSlicer'[SelectedColumn])
VAR GroupedTable =
    CALCULATETABLE(
        'Table 1',
        'FieldParameterSlicer',
        'FieldParameterSlicer'[SelectedColumn] IN SelectedColumns
    )
RETURN
    COUNTROWS(GroupedTable)

 

If you find this insightful, please provide a Kudo and accept this as a solution.

Hi Devesh

 

Getting error !!

Lavishnu_0-1707532456859.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

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.