cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ovonel
Post Patron
Post Patron

Grand Total when using IsInScope?

I have the below measure:

 

 

 

 

VAR VParent =
FILTER (
SUMMARIZE ( Revenue, 'Customer'[Parent], 'Cost'[Business] ),
[Measure1] > 0
)

VAR MaxParent = MAXX ( VParent, [Measure1] )

VAR SubT = CALCULATE ( [Measure1], VParent )

VAR VLead =
FILTER (
SUMMARIZE ( Revenue, 'Leads'[No], 'Cost'[Business] ),
[Measure1] > 0
)

VAR Max_Leads = MAXX ( VLead, [Measure1] )

VAR SubTotal_Leads = CALCULATE ( [Measure1], VLead )

RETURN
SWITCH (
TRUE (),
ISINSCOPE ( 'Customer'[Customer] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Customer'[Parent] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Leads'[Emp] ), DIVIDE ( SubTotal_Leads, Max_Leads ),
BLANK ()
)

 

 

If I select "table" visualization in Power BI, grand total appears BLANK()…

 

The measure as it is works fine, but I wanted to add a grand total whenever I display it in a table.

 

I am not sure if it is possible to display a grand total (as an average) of what is displayed. I aim to display a GrandTotal, of whatever is displayed... That is; if 'Customer'[Customer] is in scope, I aim to display the grand total for that.

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@ovonel , Try

 

SWITCH (
TRUE (),
ISINSCOPE ( 'Customer'[Customer] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Customer'[Parent] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Leads'[Emp] ), DIVIDE ( SubTotal_Leads, Max_Leads ),

not(ISINSCOPE ( 'Customer'[Customer] ) || ISINSCOPE ( 'Customer'[Parent] ) || ISINSCOPE ( 'Leads'[Emp] )) , DIVIDE ( SubT, MaxParent )
BLANK ()
)


or


AverageX(summarize(Fact, 'Customer'[Customer],'Customer'[Parent] ,'Leads'[Emp], "_1" ,
SWITCH (
TRUE (),
ISINSCOPE ( 'Customer'[Customer] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Customer'[Parent] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Leads'[Emp] ), DIVIDE ( SubTotal_Leads, Max_Leads ),
BLANK ()
)),[_1])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @ovonel ,

 

I checked @amitchandak  formula and agreed with him. You can make a try.


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

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

amitchandak
Super User IV
Super User IV

@ovonel , Try

 

SWITCH (
TRUE (),
ISINSCOPE ( 'Customer'[Customer] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Customer'[Parent] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Leads'[Emp] ), DIVIDE ( SubTotal_Leads, Max_Leads ),

not(ISINSCOPE ( 'Customer'[Customer] ) || ISINSCOPE ( 'Customer'[Parent] ) || ISINSCOPE ( 'Leads'[Emp] )) , DIVIDE ( SubT, MaxParent )
BLANK ()
)


or


AverageX(summarize(Fact, 'Customer'[Customer],'Customer'[Parent] ,'Leads'[Emp], "_1" ,
SWITCH (
TRUE (),
ISINSCOPE ( 'Customer'[Customer] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Customer'[Parent] ), DIVIDE ( SubT, MaxParent ),
ISINSCOPE ( 'Leads'[Emp] ), DIVIDE ( SubTotal_Leads, Max_Leads ),
BLANK ()
)),[_1])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors