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
ashraf_SISL1
Helper II
Helper II

count the total column using in table

Hi,

I have the tabular report below, In this, I want to add one more column where it shows a Total  days Meter Reader worked.

 

The answer is total days = 05 (06/08/10/12/14 Jan), I can do this by count no of days as all dates are not properly populated in data.  Any alternate way..like can I count the total column using in this table????

 

Meter Reader06th Jan08th Jan10th Jan12th Jan14th JanTotal days
A11123231435
B3267542375
C5686125
D55442133 5

 

1 ACCEPTED SOLUTION

Hi @ashraf_SISL1 ,

 

There is a similar thread for this as follows:

https://community.powerbi.com/t5/Desktop/Count-number-of-columns-measure/td-p/799707

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

What is the input data? If you have the dates as columns you should unpivot the source data to look more like this:

 

Meter ReaderDateValue
A06th Jan11
A08th Jan12
B06th Jan32
B08th Jan69

And so on....

 

Then you can count the number of days loaded with a measure DISTINCTCOUNT('Table'[Date]). If you want days on x axis you can use a matrix visual.

Your solution is OK, but not serving my purpose. Can we count no of columns in the table we created??

Anonymous
Not applicable

From DAX - no, you can't. There is no way to access metadata or anything like that. And it seems like a strange thing to do since you need to change the power query everytime you want to add a new date.

 

So, unpivot in power query to me still looks like the best solution available. If you want to you can use that new table in power query to count the number of dates and then join that back in to the original table as a new column and not load the unpivoted table to the data model.

Hi @ashraf_SISL1 ,

 

There is a similar thread for this as follows:

https://community.powerbi.com/t5/Desktop/Count-number-of-columns-measure/td-p/799707

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.