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
maniac234
New Member

TOTALES Y SUBTOTALES

NEcesito utilizar los totales para una medida, estoy utilizando el calculate, pero cuando llevo a la matriz, me lo genera por el elemento que lo engloba, alguien sabe como puedo tomar siempre los totales? o subtotales?

1 ACCEPTED SOLUTION
v-jiewu-msft
Community Support
Community Support

Hi @maniac234 ,

Based on the description, try using the following dax formula to get total.

 

Measure = SUMX(ALL('Table'), 'Table'[Unit])

 

vjiewumsft_0-1732870078675.png

 

Best Regards,

Wisdom Wu

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-jiewu-msft
Community Support
Community Support

Hi @maniac234 ,

Based on the description, try using the following dax formula to get total.

 

Measure = SUMX(ALL('Table'), 'Table'[Unit])

 

vjiewumsft_0-1732870078675.png

 

Best Regards,

Wisdom Wu

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

maniac234
New Member

Lo que yo necesito son los totales, para poder realizar otros calculos, te mando el print que en esos numeros que aparecen abajo de antiparacitarios, aparezca lo que esta arriba que es antiparacitarios

maniac234_0-1732646529302.png

 

Hi @maniac234 ,

 

I am not very sure about your expectations, but if you are trying to get the subtotal values replicate in each granularity, you can use below syntax. else please share some sample data and an illustration of the desired output.

value = calculate(sum(table,[value]),allexcept(table,table[subgroup column]))



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/
Sahir_Maharaj
Super User
Super User

Hello @maniac234,

 

Can you please try this approach:

DynamicTotalsAndSubtotals = 
IF(
    ISINSCOPE(DimProduct[Product]), 
    SUM(FactSales[Sales]),
    IF(
        ISINSCOPE(DimRegion[Region]),
        CALCULATE(SUM(FactSales[Sales]), REMOVEFILTERS(DimProduct)),
        CALCULATE(SUM(FactSales[Sales]), ALL(DimRegion, DimProduct))
    )
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

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.