Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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 Reader | 06th Jan | 08th Jan | 10th Jan | 12th Jan | 14th Jan | Total days |
| A | 11 | 12 | 32 | 31 | 43 | 5 |
| B | 32 | 67 | 54 | 23 | 7 | 5 |
| C | 5 | 6 | 8 | 6 | 12 | 5 |
| D | 55 | 44 | 21 | 33 | 5 |
Solved! Go to 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
What is the input data? If you have the dates as columns you should unpivot the source data to look more like this:
| Meter Reader | Date | Value |
| A | 06th Jan | 11 |
| A | 08th Jan | 12 |
| B | 06th Jan | 32 |
| B | 08th Jan | 69 |
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??
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 49 | |
| 35 | |
| 31 | |
| 30 |