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
sportdata
Regular Visitor

Solve problems with particular totals

I'm having trouble with the total for a particular column.
Try to put together a measure, which works differently depending on the level of granularity. And I'm happy with the results, but when it gets to the total, I need the results it shows to be different than what it's showing now.
In the image are all the details, but I will try to explain it too.
Specifically, I need the "total" column "mts / min", to show the division of the total column "Distances (m)" / the total column "Duration (min).

Add the formulas that I use in the picture and send the pbix file

I'm not sure you can actually do that.

Thank you

 

 

Example bad total result m_min.jpg

 

https://drive.google.com/file/d/1D7KQmIcsvkCn8lDJnbm2rkIROCZQmtf1/view?usp=sharing 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

https://community.powerbi.com/t5/Power-Query/Row-Total-Average/td-p/965757
This might help you
You need a conditional statement to show diffrent values for totals

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

https://community.powerbi.com/t5/Power-Query/Row-Total-Average/td-p/965757
This might help you
You need a conditional statement to show diffrent values for totals

I solve 

thanks

 

Hierrarchi m_min =
VAR dr_ath_ses = CALCULATE([m_min_calc],
KEEPFILTERS(VALUES('Tabla2'[Athlete])),
ALLEXCEPT(Tabla2,Tabla2[Drill],Tabla2[Athlete],Tabla2[Session]))

VAR Ath_ses = CALCULATE([m_min_calc],
KEEPFILTERS(VALUES('Tabla2'[Athlete])),
ALLEXCEPT(Tabla2,Tabla2[Athlete],Tabla2[Session]))

VAR ses = CALCULATE([m_min_calc],
KEEPFILTERS(VALUES('Tabla2'[Athlete])),
ALLEXCEPT(Tabla2,Tabla2[Session]))



VAR grandtotal = Calculate(DIVIDE([Distance (m)],[Duration (min)]))
 
Return

SWITCH(
true(),
ISINSCOPE(Tabla2[Drill]), dr_ath_ses,
ISINSCOPE(Tabla2[Athlete]),Ath_ses,
ISINSCOPE(Tabla2[Athlete]),ses,grandtotal)
 

I wanted to thank you. I implemented ISINSCOPE, and it worked.

The values are correct, but now if some athletes did exercise A, it shows me the data of exercise A, but it also shows me values in those players who did not do those exercises.

I hope you understand what I mean.

Thanks.athletes extras sin datos.jpg

 
Hierrarchi m_min =
VAR dr_ath_ses = CALCULATE([m_min_calc],
ALLEXCEPT(Tabla2,Tabla2[Drill],Tabla2[Athlete],Tabla2[Session]))

VAR Ath_ses = CALCULATE([m_min_calc],
ALLEXCEPT(Tabla2,Tabla2[Athlete],Tabla2[Session]))

VAR ses = CALCULATE([m_min_calc],
ALLEXCEPT(Tabla2,Tabla2[Session]))


VAR grandtotal = Calculate(DIVIDE([Distance (m)],[Duration (min)]))
 
Return

SWITCH(
true(),
ISINSCOPE(Tabla2[Drill]), dr_ath_ses,
ISINSCOPE(Tabla2[Athlete]),Ath_ses,
ISINSCOPE(Tabla2[Athlete]),ses,grandtotal)

OK, I'm new to all this, I'll try to use your suggestion.
From already thank you very much.

 

Diego 

 

 

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