Reply
ashmitp869
Post Patron
Post Patron
Partially syndicated - Outbound

TOTAL of Cost in Matrix view not working ?

Hi,

I am using matrix for this report

ashmitp869_0-1738711975931.png

The Cost is a measure -

Cost = SWITCH(
SELECTEDVALUE(Plan_DailyPlanHoursResourceVersion[ResourceType]),
3001,CALCULATE(SUMX(Plan_DailyPlanHoursResourceVersion,Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] * RELATED(Core_ProjectEquipment[UnitCost])) ),
3003,CALCULATE(SUMX(Plan_DailyPlanHoursResourceVersion,Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] * RELATED(Core_ProjectEmployee[StraightTimeRate])) )
) 

The TOTAL at the Cost is not working. ? How can I make it work - to get TOTAL of Cost $ 914, 010 ?
Please suggest.

1 ACCEPTED SOLUTION
Shravan133
Super User
Super User

Syndicated - Outbound

use HASONEVALUE instead of SELECTEDVALUE in your measure. Please verify ther esults after modifying the measure.

Cost =
IF(
HASONEVALUE(Plan_DailyPlanHoursResourceVersion[ResourceType]),
SWITCH(
SELECTEDVALUE(Plan_DailyPlanHoursResourceVersion[ResourceType]),
3001, SUMX(
Plan_DailyPlanHoursResourceVersion,
Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] * RELATED(Core_ProjectEquipment[UnitCost])
),
3003, SUMX(
Plan_DailyPlanHoursResourceVersion,
Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] * RELATED(Core_ProjectEmployee[StraightTimeRate])
)
),
-- Handling Totals:
SUMX(
Plan_DailyPlanHoursResourceVersion,
Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] *
SWITCH(
TRUE(),
Plan_DailyPlanHoursResourceVersion[ResourceType] = 3001, RELATED(Core_ProjectEquipment[UnitCost]),
Plan_DailyPlanHoursResourceVersion[ResourceType] = 3003, RELATED(Core_ProjectEmployee[StraightTimeRate]),
0
)
)
)

View solution in original post

1 REPLY 1
Shravan133
Super User
Super User

Syndicated - Outbound

use HASONEVALUE instead of SELECTEDVALUE in your measure. Please verify ther esults after modifying the measure.

Cost =
IF(
HASONEVALUE(Plan_DailyPlanHoursResourceVersion[ResourceType]),
SWITCH(
SELECTEDVALUE(Plan_DailyPlanHoursResourceVersion[ResourceType]),
3001, SUMX(
Plan_DailyPlanHoursResourceVersion,
Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] * RELATED(Core_ProjectEquipment[UnitCost])
),
3003, SUMX(
Plan_DailyPlanHoursResourceVersion,
Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] * RELATED(Core_ProjectEmployee[StraightTimeRate])
)
),
-- Handling Totals:
SUMX(
Plan_DailyPlanHoursResourceVersion,
Plan_DailyPlanHoursResourceVersion[ApprovedStdHours] *
SWITCH(
TRUE(),
Plan_DailyPlanHoursResourceVersion[ResourceType] = 3001, RELATED(Core_ProjectEquipment[UnitCost]),
Plan_DailyPlanHoursResourceVersion[ResourceType] = 3003, RELATED(Core_ProjectEmployee[StraightTimeRate]),
0
)
)
)

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)