cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdrammeh Member
Member

Display Spend By Manager, Region, and Code Against Target Dollars

Dear Friend and Mentors,

 

I am working on a report view that looks like this in Excel where I am given a set of target dollars by different managers region, code etc:

 

PowerQuery_Scenario.PNG

 

The target dollars are provided by different managers responsible for different regions. Each manager has a unique way of calculating their target dollars but they both use the same dashboard to present the group’s metric.

 

Currently, I am using a pivot table to group each manager’s Spend by Region and Code. The spend is already available in my query (Power Query) but there is no record of how the target dollars are calculated. Therefore, I want to make a an assumption by calculating the proportion of target dollars against each manager, region, and code so that when I create my pivot the sub-totals/grand totals would add up to the target dollars. To get around this situation, I am using a table and manually populating target dollars as they change. I would like to be able to include criteria in my Query that will automatically calculate the proportion of Target dollars and group them by Code in more detail so that it would show up in my pivot table or dashboard.

 

Any thoughts as for how I can approach this differently in Power Pivot, Power Query or Power BI? 

 

Thanks for all your help in advance!

 

Mdrammeh

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Display Spend By Manager, Region, and Code Against Target Dollars

Hi @mdrammeh,

 

I'd like to suggest you add condition to check each total level with switch function to manual display the result.

 

For example:

Total Measure(Row Count) = 
IF(ISBLANK(MAX('Table'[Date]))=FALSE(),
if(COUNT('Table'[Date])=COUNTX(ALL('Table'),[Date]),
 "All", 
 if(COUNT('Table'[Date])=COUNTX(FILTER(ALL('Table'),[Date].[Year]=MAX([Date].[Year])),[Date]),
	 "Year Level Total",
	 if(COUNT('Table'[Date])=COUNTX(FILTER(ALL('Table'),[Date].[Year]=MAX([Date].[Year])&&[Date].[QuarterNo]=MAX([Date].[QuarterNo])),[Date]),
		 "Quarter Level Total",
		 	 if(COUNT('Table'[Date])=COUNTX(FILTER(ALL('Table'),[Date].[Year]=MAX([Date].[Year])&&[Date].[QuarterNo]=MAX([Date].[QuarterNo])&&[Date].[MonthNo]=MAX([Date].[MonthNo])),[Date]),
		 	"Month Level Total",
			 "Day Level Total")
			 ))))

1.PNG

 

In addition, you can try to use lastnonblank function to get the current text content.

 

BTW, the total function only available on original data, if your data are manual inputted, you have to manual calculate and use switch function to display them.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Display Spend By Manager, Region, and Code Against Target Dollars

Hi @mdrammeh,

 

I'd like to suggest you add condition to check each total level with switch function to manual display the result.

 

For example:

Total Measure(Row Count) = 
IF(ISBLANK(MAX('Table'[Date]))=FALSE(),
if(COUNT('Table'[Date])=COUNTX(ALL('Table'),[Date]),
 "All", 
 if(COUNT('Table'[Date])=COUNTX(FILTER(ALL('Table'),[Date].[Year]=MAX([Date].[Year])),[Date]),
	 "Year Level Total",
	 if(COUNT('Table'[Date])=COUNTX(FILTER(ALL('Table'),[Date].[Year]=MAX([Date].[Year])&&[Date].[QuarterNo]=MAX([Date].[QuarterNo])),[Date]),
		 "Quarter Level Total",
		 	 if(COUNT('Table'[Date])=COUNTX(FILTER(ALL('Table'),[Date].[Year]=MAX([Date].[Year])&&[Date].[QuarterNo]=MAX([Date].[QuarterNo])&&[Date].[MonthNo]=MAX([Date].[MonthNo])),[Date]),
		 	"Month Level Total",
			 "Day Level Total")
			 ))))

1.PNG

 

In addition, you can try to use lastnonblank function to get the current text content.

 

BTW, the total function only available on original data, if your data are manual inputted, you have to manual calculate and use switch function to display them.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors