cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mdrammeh Helper III
Helper III

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
Community Support

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
Community Support

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
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors