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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ansa_naz
Continued Contributor
Continued Contributor

How to show grouped totals in a table?

Hi all

I have the following tables and structure:

 

Tables:

Sites

Lifts

Customers

Sales

 

They are linked as below:

Sales M --- 1 Lifts

Lifts M --- 1 Sites

Sites M ---1 Customers

 

Table structure is as follows:

Lifts:

LiftID     SiteID     LiftName

 

Sites:

SiteID     CustomerID     SiteName

 

Customers:

CustomerID     CustomerName

 

Sales:

SalesID    CustomerID    SiteID    LiftID    Amount    Date

 

In a table visual, I want to show the following:

 

SiteName             LiftName           TotalAmountForSite


So the amount column in the visual will show the total Sales for the Site, not the Lift. Is this possible using a measure somehow? Currently, if I add Sites.SiteName, Lifts.LiftName and Sales.Amount into the table, the Amount column shows the total per Lift, but I need it for Site

 

This is what I have now:

 

Group total.jpg

 

But I need:

 

SiteName      LiftName      Amount

Site 1            Lift 1             668.00

Site 1            Lift 2             668.00

Site 2            Lift 3             604.00

Site 3            Lift 4             9.54

Site 4            Lift 6             9622.50

Site 4            Lift 8             9622.50

Site 4            Lift 9             9622.50

 

See below PBIX file for data being used:

https://1drv.ms/u/s!AuiIgc_S9J5JhbYbCO2jbeQPfpzmXw

 

Cheers for all help

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @ansa_naz ,

Based on my test, you could refer to below measure:

Measure 2 = IF(ISBLANK(CALCULATE(SUM(Sales[Amount]))),BLANK(),SUMX(ALL(Sales),CALCULATE(SUM(Sales[Amount]),FILTER(ALL(Sites),'Sites'[SiteName]=MAX(Sites[SiteName])))))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @ansa_naz ,

Based on my test, you could refer to below measure:

Measure 2 = IF(ISBLANK(CALCULATE(SUM(Sales[Amount]))),BLANK(),SUMX(ALL(Sales),CALCULATE(SUM(Sales[Amount]),FILTER(ALL(Sites),'Sites'[SiteName]=MAX(Sites[SiteName])))))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-danhe-msft I would never have got this solution by myself, its tricky!

wasnt sure if you where just wanting the table to show site totals or a table to show site totals next to totals for lift 

 

eaither way i have altered your PBIX file to do what you asked.

 

changed the relationships in the flow 

added a calculated colunm and changed your measures 

 

PBIX File





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @AnthonyTilley  thanks for your reply. Sadly I couldnt check what you attached as it seems to be for some other user? Not to wrry, the other reply works perfect! Cheers for your help

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.