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

Drilldown to show sum of measures value

Hi guys,

 

I think this problem is quite common, but I could not find an easy guide to solve it.

 

I have a forecast of X and actuals of Y. I caculated the ABS ERROR (ABS(Forecast-Demand)).

What I would like to happen is that the upper level of my most disaggregated information would be the sum of all those ABS ERROR and not the variance at the aggregated level.

 

How I calculated so far the 3 mesures:

 

Forecast = calculate(sum(forecast)) --> Forecast 1

Demand = calculate(sum(demand)) --> Actuals1

abserror = abs(forecast-demand) --> ABS1

 

So here below at the upper level, row = PR208 the ABS 1  should be the sum of all the below calculation, the value should be >100k+

riccardoprade93_0-1653480794618.png

 

Thanks everyone!!!!!!!!

 

1 ACCEPTED SOLUTION

Hi,

This measure works

ABS3 = if(hasonevalue('Dataset Agg'[SHIP_FROM]),[ABS 1],SUMX(VALUES('Dataset Agg'[SHIP_FROM]),[ABS 1]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Measure = SUMX(VALUES('Table'[Sub_Sales]),[ABS1])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

It works for the upper level, but it will not calculate correctly at the lower level, it is a good trick though.

riccardoprade93_0-1653911627607.png

 

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

This measure works

ABS3 = if(hasonevalue('Dataset Agg'[SHIP_FROM]),[ABS 1],SUMX(VALUES('Dataset Agg'[SHIP_FROM]),[ABS 1]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

one last comment, can you explain me possibly why if I aggregate one level more, the math does not work?

riccardoprade93_0-1653920152701.png

 

 

Hi,

Try this measure

Measure = SUMX(SUMMARIZE('Dataset Agg','Dataset Agg'[SHIP_FROM],'Dataset Agg'[U_SUB_DIV],'Dataset Agg'[Period],"ABCD",[ABS 1]),[ABCD])

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

ah this works perfectly! Thanks so much... If you have the time, could you help me understanding the formula?

 

Why HASNOVALUE?

v-kkf-msft
Community Support
Community Support

Hi @riccardoprade93 ,

 

Please try the measure. 'Table'[Sub_Sales] is the field to which "74808.61R/1110", "Y60NAOH48.91R/1980", etc. belong.

 

ABS1 = 
SUMX (
    VALUES ( 'Table'[Sub_Sales] ),
    CALCULATE ( ABS ( [Forecast 1] - [Actuals1] ) )
)

vkkfmsft_1-1653874991811.png

vkkfmsft_0-1653874971151.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Hey! thanks a lot, but somehow the formula does not replicate in my PowerBI the result that you have.

It will show the sum of the ABS ERROR as well for the lower level. I tried to check for any error, but could not find any. Any idea??

 

riccardoprade93_1-1653912266887.png

 

 

ABS3 =
SUMX (
VALUES ('Dataset Agg'[SHIP_FROM] ),
CALCULATE ( ABS ( [Forecast 1]- [Actuals 1] ) )
)

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.