Forum Discussion

mdrammeh's avatar
mdrammeh
Icon for Helper III rankHelper III
9 years ago
Solved

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:

 

 

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

  • Anonymous's avatar
    Anonymous
    9 years ago

    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")
    			 ))))

     

    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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    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")
    			 ))))

     

    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