Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ysherriff
Resolver II
Resolver II

Split total by group

In the image below, i have some duplicate values, which is okay but I would like to split the total over the entire group. For instance, in the below image, for BC#1598-01, it has a value of $5,812,204 and there are 5 campaigns associated with it. I would like to split the $5,812,204 over the five campaigns. I tried it with this measure but its not working. Any help is appreciated.

 

Avg $ Global or Potential =
 CALCULATE(
     AVERAGE( Campaigns[Global or Potential]),
        FILTER(
         ALL( Campaigns),
           Campaigns[BC #] = MAX(Campaigns[BC #])))

ysherriff_0-1661522415705.png

 

2 ACCEPTED SOLUTIONS

Hi @ysherriff ,

 

Please try following DAX, you will get the SUM in total:

 

Avg $ Global or Potential = 
IF(
    ISINSCOPE(Campaigns[Campaigns ID]),
    Divide(
CALCULATE(
AVERAGE( Campaigns[Global or Potential]),
FILTER(
ALL( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) ,
CALCULATE(
Count( Campaigns[Campaigns ID]),
FILTER(
ALL( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) ),
SUM(Campaigns[Global or Potential])
)

 

 

Best regards,

Yadong Fang

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

View solution in original post

Here is the formula:

Thanks Yadong Fang. Below is the formula that was provided that was correct.

 

 

Correct Average Total Amount =
IF( ISINSCOPE( Campaigns[Campaign ID] ) ,
    [Average $ Global or Potential] ,
    SUMX(
        ADDCOLUMNS(
            SUMMARIZE(
                Campaigns ,
                Campaigns[Campaign ID] ,
                Campaigns[BC #] ) ,
            "@Totals" ,
            [Average $ Global or Potential] ) ,
        [@Totals] ) )

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@ysherriff , Try

 

Avg $ Global or Potential =
Divide(
CALCULATE(
AVERAGE( Campaigns[Global or Potential]),
FILTER(
ALL( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) ,
CALCULATE(
Count( Campaigns[Campaigns ID]),
FILTER(
ALL( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) )

 

 

or

 

 

Avg $ Global or Potential =
Divide(
CALCULATE(
AVERAGE( Campaigns[Global or Potential]),
FILTER(
ALLSelected( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) ,
CALCULATE(
Count( Campaigns[Campaigns ID]),
FILTER(
ALLSelected( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks Amit but how do i show the total. The total is showing the averages but I want it to show the sum. It should be $99M

ysherriff_0-1661524576265.png

 

 

 

Hi @ysherriff ,

 

Please try following DAX, you will get the SUM in total:

 

Avg $ Global or Potential = 
IF(
    ISINSCOPE(Campaigns[Campaigns ID]),
    Divide(
CALCULATE(
AVERAGE( Campaigns[Global or Potential]),
FILTER(
ALL( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) ,
CALCULATE(
Count( Campaigns[Campaigns ID]),
FILTER(
ALL( Campaigns),
Campaigns[BC #] = MAX(Campaigns[BC #]))) ),
SUM(Campaigns[Global or Potential])
)

 

 

Best regards,

Yadong Fang

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

Here is the formula:

Thanks Yadong Fang. Below is the formula that was provided that was correct.

 

 

Correct Average Total Amount =
IF( ISINSCOPE( Campaigns[Campaign ID] ) ,
    [Average $ Global or Potential] ,
    SUMX(
        ADDCOLUMNS(
            SUMMARIZE(
                Campaigns ,
                Campaigns[Campaign ID] ,
                Campaigns[BC #] ) ,
            "@Totals" ,
            [Average $ Global or Potential] ) ,
        [@Totals] ) )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.