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
giuliapiazza94
Helper IV
Helper IV

% Sales and grand TOTAL

Hi guys,

I have a table like this

giuliapiazza94_0-1639646659868.png

and I'd like a % value on grand total like this

giuliapiazza94_1-1639646708365.png

But if I filter customer (only A and C) I'd like this

giuliapiazza94_2-1639646991431.png

 

Can you help me please? 😊

 

 

1 ACCEPTED SOLUTION

Hi, thank you so much but I have found a easier fomula dax.

 

Sales % = DIVIDE (SUM(sales), calculate( SUM(sales), ALLSELECTED ('Table customers' (customer))) and work very well 😀

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Hi @giuliapiazza94 ,

 

Create two measure like below:-

Sales_ = 
SUMX (
    SUMMARIZE ( Sales_data, Sales_data[customer], "sum", [Sales_Total] ),
    [sum]
)
Sales_Total = 
VAR maxevery =
    CALCULATE (
        sum ( 'Sales_data'[sales] ),
        FILTER ( ALL ( 'Sales_data' ), 'Sales_data'[customer] = MAX ( 'Sales_data'[customer] ) )
    )
VAR total_sum =
    calculate(SUM ( 'Sales_data'[sales] ),ALL(Sales_data))
RETURN
 DIVIDE ( maxevery, total_sum )

 

Now use customer column and sales_ measure in a table visual

Samarth_18_0-1639649297242.png

 

Thanks,

Samarth

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi, thank you so much but I have found a easier fomula dax.

 

Sales % = DIVIDE (SUM(sales), calculate( SUM(sales), ALLSELECTED ('Table customers' (customer))) and work very well 😀

@giuliapiazza94 , Just check if its working correctly when you select value from filter. 🙂

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

it works if I filter customer and the other tables too (like calendar) 🙂

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.

Top Solution Authors