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
Anonymous
Not applicable

Get Row category value next to all sub-category values.

Hello, I was wondering if anyone could help me, I've tried many different things and can't get it to work in my favor.

 

In simple terms: I want to create a new column that that gives me the total category value next  all subtotals value.

209B2B87-2C29-41F0-A9C8-257F8394EA3D.jpeg

  Above is a dumby chart with the calculations I have already done, as it is now: it's just pulls same data over(not how I want it).

(Total should be Vegetable Total+Fruit Total, please ignore the 268 and 828)

 

thank you for any suggestions!

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

You may try creating a calculated column as below.

Column =
CALCULATE (
    SUM ( Table[values] ),
    FILTER (
        ALL ( Table ),
        Table[category] = EARLIER ( Table[category] )
            && Table[Quarter] = EARLIER ( Table[Quarter] )
    )
)

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try a formula like

calculate(sum(Table[values]), filter(allselcted(Table), Table[category] =max(table[category]) && Table[Quarter] =max(table[Quarter])))

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Anonymous
Not applicable

This worked however Is there any way to translate this into a calculated column, I do not want the data to dynamically change with filters, I want to create a Category total for all subtotals in the Data view, any suggestions on how to do it?

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.