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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
rssilvaba
Resolver II
Resolver II

How to get the number of columns in a bar chart or the number of rows in the represented table?

Hi All, 

I was wondering how I can get the number of columns in the current chart or to be more specific, the number of rows of it table representation as in the image below:

Capture3.PNG

 

I tried a some measures or lookin in the forum but I did not find anything. Any ideas how I can get this count with a DAX Measure?

Thanks

1 ACCEPTED SOLUTION

I figure it out. With the measure I get the right number for any size every time.

# of Observations = COUNTROWS(ALLSELECTED('Calendar'[Year Quarter]))

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@rssilvaba , In this case, distinctcount (Table[year quarter]) should give you

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

@amitchandak , Thanks for the anwser this gives a single number for each row:

Capture4.PNG

 How do I aggregate them into a single number (12)? Sorry if this is obvious to you, I don't have much exprience with PBI.

I figure it out. With the measure I get the right number for any size every time.

# of Observations = COUNTROWS(ALLSELECTED('Calendar'[Year Quarter]))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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