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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
charlyrosero
Frequent Visitor

Count Rows per Group in Table

Hi everyone

 

i've this dataset, i need to count the rows per group (Area) and after multiply by column value (Weight). i try this isn't works

 

Rows per Area = CALCULATE(COUNT(BSC[AREA]),ALLEXCEPT(BSC,BSC[KPI]))

 

Rows per IT Area = 3, Rows per Financial Area =2.

 

Month AreaKPIWeightRows per AreaResultFORMULA
JanuaryITKPI 10,330,9(Weight (0,3) * Quantity Kpi Per Area (3)
JanuaryITKPI 20,2530,75(Weight (0,75) * Quantity Kpi Per Area (3)
JanuaryITKPI 30,4831,44(Weight (0,48) * Quantity Kpi Per Area (3)
JanuaryFinancialKPI 40,120,2(Weight (0,1) * Quantity Kpi Per Area (2)
JanuaryFinancialKPI 50,8521,7(Weight (0,85) * Quantity Kpi Per Area (2)
1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @charlyrosero 

 

Try below measures:

Measure = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Area]))
Measure 2 = [Measure]*MAX('Table'[Weight])

 02.PNG

Pbix attached.

Community Support Team _ Dina Ye
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

3 REPLIES 3
danextian
Super User
Super User

Hi @charlyrosero ,

 

Your current formula is the rows per KPI. Change it to 

Rows per Area =
CALCULATE ( COUNT ( BSC[AREA] ), ALLEXCEPT ( BSC, BSC[Area] ) )

If you need rows per are per month per kpi, use below formula

Rows per Area =
CALCULATE (
    COUNT ( BSC[AREA] ),
    ALLEXCEPT ( BSC, BSC[Month], BSC[Area], BSC[KPI] )
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
v-diye-msft
Community Support
Community Support

Hi @charlyrosero 

 

Try below measures:

Measure = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Area]))
Measure 2 = [Measure]*MAX('Table'[Weight])

 02.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

I am not sure about the role of formula. But seems like you need subtotal

 

Measure = CALCULATE(COUNT('Table'[Area]),ALLEXCEPT('Table','Table'[Area],'Table'[Month]))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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