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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Set total count as record count

Hi,

I have a table where I calculate the count of days, but I want the total count in all rows and not only in the of the TOTAL at the bottom of the table, I have shared the pics of my current result and the expected output, All three columns are from different tables.Also the count of days will have to decrease as the records decreases(I guess that will happen automatically in power bi), What DAX can be used to acheive this.Capture.PNG

DateWeekdayCount of days
1/2/2016Sunday731
20/02/2016Monday731
1/3/2016Wednesday731
2/3/2017Monday731
4/7/2016Saturday731
Total 731

 

 Regards,

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

I assume that you added the day column directly from table into visual and choosed 'count' aggregation which returned 1 for each row, right?

 

To display the total count in all rows, please add a measure into visual which is created as below:

Count of days = CALCULATE(COUNT('TableName'[Date]),ALL('TableName'))

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi v-yulgu-msft

Capture1.PNGCapture3.PNGThanks for your reply, I have used your DAX I get the desired output when I have only weekdays and  Count of days, but when I include a column "Date" from Table 2 the values gets drilled down, but I want the same 731 as a result even when I include date column, is this possible with DAX?

 

Regards,

Hi @Anonymous,

 

Actually, the count values will keep 731 even we add another column into visual. Please check whether you have used ALL function in DAX formula as I mentioned above. Besides, if it still doesn't work, instead of using a measure, you can create a calculated column with the same DAX formula. 

 

By the way, all above columns are from a single table, right?

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi v-yulgu-msft,

The weekdays and  Count of days columns are from Table 1 and  "Date" column is from Table 2.

I guess thats why I am not getting the desired o/p, How can I use the Table 2 columns also in side the formula.

 

Regards,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.