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
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
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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.