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
Anonymous
Not applicable

Measure to display default value based on default attribute in PowerBI

Hi,

I have scenario where the measure should display default value based on default attribute when measure alone is used.
Whereas measure should slice it's value when particular attribute is selected.
E.g.,
Employee table: 

EmpIdEmpNameDepartment
1JoeHR
2LeeFIN
3RayMKT


Salary table: 

EmpIdSalary
1100
2200
3300

 

As default when only Salary column is used then it displays sum of all the Salary.
Instead of summing up all the Salary, it should sum up only where Department=HR as default.I created custom measure for this, default behaviour is working fine but when EmpName attribute and CustomSalary measure are used then Total value displays default value. 

 

Please advice how to overcome this.

 

CustomSalary = IF(
HASONEFILTER(Employee[EmpName]) ,
SUM(Salary[Salary]),
CALCULATE(SUM(Salary[Salary]),Employee[Department] = "HR" )
)

 

nabha_1-1666806120710.png

 

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

Not entirely clear what you want...

Anonymous
Not applicable

Thanks for looking into this.

Total should display as value 600 (sum of all the Salary) instead of 100 (default Department=HR).

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.