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

View all the Fabric Data Days sessions on demand. View schedule

Reply
eyesem
Helper I
Helper I

Total by group at row level

Hi

 

I need to get a measure 'Qcartera' as the sum of all the QA values for each distinct NISS in the filtered view of the table (in this example the applied filters are narrowing down the table to 2 distinct NISS).

 

I've tried this these options, but I always get as Qcartera the QA of each NISS, I need the sum of all the different NISS (the expected value is 36.301.384 in each row):

Qcartera = SUMX(SUMMARIZE('Conceptos Contratados Datos','Conceptos Contratados Dimensiones'[NISS],"Qcartera",SUM('Conceptos Contratados Datos'[QA])),[Qcartera])

Qcartera = CALCULATE(SUM('Conceptos Contratados Datos'[QA]),SUMMARIZE('Conceptos Contratados Datos','Conceptos Contratados Dimensiones'[NISS],"QaTotal",SUM('Conceptos Contratados Datos'[QA])))

Qcartera = SUMX(VALUES('Conceptos Contratados Dimensiones'[NISS]),CALCULATE(MAX('Conceptos Contratados Datos'[QA])))

 

 

Captura de pantalla 2021-02-12 200959.png

 

Note: 'Conceptos Contratado Datos' and 'Conceptos Contratados Dimensiones' are related by an unique id row by row.

 

Any help?

 

Thanks!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@eyesem try this measure, now I understood your model better:

 

Measure = 
CALCULATE(
    SUMX ( 
        VALUES ( 'Dimension'[CODE] ),
        CALCULATE (MAX ( 'Fact'[QA] ) )
    ),
    FILTER (
        ALLSELECTED ('Fact' ), 
        COUNT ('Fact'[INDEX] ) >=1 
    )
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@eyesem try this measure, now I understood your model better:

 

Measure = 
CALCULATE(
    SUMX ( 
        VALUES ( 'Dimension'[CODE] ),
        CALCULATE (MAX ( 'Fact'[QA] ) )
    ),
    FILTER (
        ALLSELECTED ('Fact' ), 
        COUNT ('Fact'[INDEX] ) >=1 
    )
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Wow, thank you very much. I would have never been able to do it!

parry2k
Super User
Super User

@eyesem something I'm missing here, It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@eyesem try this measure

 

Measure = CALCULATE ( SUMX ( ALL ( Data[QA], Data[NISS] ) , CALCULATE ( MAX ( Data[QA] ) ) ), ALL () )

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I've prepared a simplified data set for this purpose:

 

https://drive.google.com/drive/folders/1-bACZciPecBj7LD4wGKrOlhoiyCQGY4M?usp=sharing

 

When the view is filtered by April'21 we'll have only 4 different codes, and the expected result of the measure is the sum of QA of these 4 codes (273.681.384)

 

Captura de pantalla 2021-02-13 102016.png

 

What I'm really trying to do is to weight the Value by the Qtotal.

 

Thank you!

Thank you for your reply.

This doesn't seem to be working either. It is creating duplicated rows and the measure seems to be adding all the rows, not only the two in the table:

 

Captura de pantalla 2021-02-12 214429.png

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors