Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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(
Solved! Go to Solution.
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!!
Proud to be a Super User! | |
Thanks that helped a lot.
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!!
Proud to be a Super User! | |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |