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

Show grand total as a new column

Hello,

 

I have a relatively easy question (I guess) that I cannot find the solution.

 

In the table below, I want the last column (TotalActiveDays) to show the total number of days (252) in each line, as I am showing

 

Untitled.png

Thanks

1 ACCEPTED SOLUTION

Capture.JPG

 

What you propose is not working.

 

What I have done though, is to create a new table named "Dates" summarising the dates 

dates = DISTINCT(OrderBase[OrderDate])

 

and then I have created a measure to calculate them

GrandTotalActiveDays = COUNT(dates[OrderDate]) 

 

Capture.JPG

Not sure if it is the optimum way, however it worked

View solution in original post

6 REPLIES 6
tex628
Community Champion
Community Champion

Or when i'm looking at this more closely, do you want the totalactivedays to reflect the highest value of activedaysorderbase? 


Connect on LinkedIn

Thanks for the answers.

 

I don't want the totalactivedays to reflect the highest value. In this example, the highest is 251 whereas the total is 252.

 

Additionally, I don't want to equal it with a specific value as a column because I want it to be dynamic when I am refreshing the database. For example, if another dataset has 300 distinct active days, I want the TotalActiveDays column to have the value 300 in each row.

 

Therefore, I guess I need to do that with a measure like:

 

TotalActiveDays = CALCULATE( DISTINCTCOUNT(OrderBase[OrderDate]),XXXXX)

tex628
Community Champion
Community Champion

Play around with Measure = Distinctcount(all(Table[Column]))

 

Since i cant view your dataset i cant really specify which column you should count the rows of! 

 

 / J


Connect on LinkedIn

Capture.JPG

 

What you propose is not working.

 

What I have done though, is to create a new table named "Dates" summarising the dates 

dates = DISTINCT(OrderBase[OrderDate])

 

and then I have created a measure to calculate them

GrandTotalActiveDays = COUNT(dates[OrderDate]) 

 

Capture.JPG

Not sure if it is the optimum way, however it worked

tex628
Community Champion
Community Champion

Right, it's been a long day... Distinctcount is for columns and distinct for tables. 

That should work, glad it worked out! 

/ J


Connect on LinkedIn
tex628
Community Champion
Community Champion

Create a calculated column and equal it to 252 then display that column in the visual. The column should be in the same table as SKU. 

 

This should work if 252 is a constant, if it needs to be dynamic in some way you will need a different formula.

 

/ J


Connect on LinkedIn

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!

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.