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

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

Reply
Fora
Frequent Visitor

Putting a project and an dynamic average of projects in the same visual.

Hey, 

I want to put the project that i selected with a slycer, and an average of other projects I can dynamicaly select with another slycer, into the same visual. I already managed to calculate the average for the projects independently from the selected project i want to compare, but i didn't manage to put both into one visual, because then the slycers for the single project interfere with the slycer for the average. I actually have 3 visuals, one for the project in general, then one for the domains of the project and one for the costcenters within the domains. But there is always only one domain and costcenter selected at the same time.

Here is my code for the average:AverageProject = CALCULATE(

    DIVIDE(
        SUMX(
            ALLSELECTED(Append1);
            Append1[ForecastCurrentMonth]
        );
        CALCULATE(
            DISTINCTCOUNT(Append1[Description]);
            ALLSELECTED(Append1[Description])
        );
        0
    )
)
 
AverageDomain =
CALCULATE(
    DIVIDE(
        SUMX(
            ALLSELECTED(Append1);
            [ForecastCurrentMonthForAverage]
        );
        CALCULATE(
            DISTINCTCOUNT(Append1[Description]);
            ALLSELECTED(Append1[Description]);
             REMOVEFILTERS('Costcenter by Domain'[Domain]) --Remove if Projects with 0 shoudn`t count
        );
    0
    )
)
 
AverageCostcenter =
CALCULATE(
    DIVIDE(
        SUMX(
            ALLSELECTED(Append1);
            [ForecastCurrentMonthForAverage]
        );
        CALCULATE(
            DISTINCTCOUNT(Append1[Description]);
            ALLSELECTED(Append1[Description]);
             REMOVEFILTERS('Costcenter by Domain'[Domain]; 'Costcenter by Domain'[Costcenter]) --Remove if Projects with 0 shoudn`t count
        );
    0
    )
)
 
 
1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Fora -create a measure for selected project as below:

 

SelectedProject =
CALCULATE(
DIVIDE(
SUMX(
Append1,
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description])
),
0
)
)

 

create another measure to get the average of other projects

AverageOtherProjects =
CALCULATE(
DIVIDE(
SUMX(
ALL(Append1),
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description]),
ALL(Append1[Description])
),
0
),
NOT( Append1[Description] IN VALUES(Append1[Description]) )
)

 

Now calcualte domain average 

AverageDomain =
CALCULATE(
DIVIDE(
SUMX(
ALL(Append1),
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description]),
ALL(Append1[Description]),
REMOVEFILTERS('Costcenter by Domain'[Domain])
),
0
),
NOT( Append1[Description] IN VALUES(Append1[Description]) )
)

 

calculate the average cost center as 

 

AverageCostcenter =
CALCULATE(
DIVIDE(
SUMX(
ALL(Append1),
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description]),
ALL(Append1[Description]),
REMOVEFILTERS('Costcenter by Domain'[Domain], 'Costcenter by Domain'[Costcenter])
),
0
),
NOT( Append1[Description] IN VALUES(Append1[Description]) )
)

 

Hope the above approach helps to get the dynamically select project/domain and cost center

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Fora
Frequent Visitor

Thanks that helped a lot.

rajendraongole1
Super User
Super User

Hi @Fora -create a measure for selected project as below:

 

SelectedProject =
CALCULATE(
DIVIDE(
SUMX(
Append1,
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description])
),
0
)
)

 

create another measure to get the average of other projects

AverageOtherProjects =
CALCULATE(
DIVIDE(
SUMX(
ALL(Append1),
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description]),
ALL(Append1[Description])
),
0
),
NOT( Append1[Description] IN VALUES(Append1[Description]) )
)

 

Now calcualte domain average 

AverageDomain =
CALCULATE(
DIVIDE(
SUMX(
ALL(Append1),
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description]),
ALL(Append1[Description]),
REMOVEFILTERS('Costcenter by Domain'[Domain])
),
0
),
NOT( Append1[Description] IN VALUES(Append1[Description]) )
)

 

calculate the average cost center as 

 

AverageCostcenter =
CALCULATE(
DIVIDE(
SUMX(
ALL(Append1),
Append1[ForecastCurrentMonth]
),
CALCULATE(
DISTINCTCOUNT(Append1[Description]),
ALL(Append1[Description]),
REMOVEFILTERS('Costcenter by Domain'[Domain], 'Costcenter by Domain'[Costcenter])
),
0
),
NOT( Append1[Description] IN VALUES(Append1[Description]) )
)

 

Hope the above approach helps to get the dynamically select project/domain and cost center

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.