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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
trwatts
Helper I
Helper I

Has one value with a field parameter error

Hi everyone, 

 

I am looking to use the hasonevalue and switch true to dynamically present some trend information using a field parameter. 

The below is the error and dax I currently have. 
Any help would be great. 

Error:
Calculation error in measure 'Switch Measures[Test Switch Value BUD Financial]: Column [Parameter Trend] is part of composite key, but not all columns of the composite key are included in the expression or its dependant expression

Dax:

Test Switch Value BUD Financial =
IF(HASONEVALUE('Parameter Trend'[Parameter Trend]),
SWITCH(TRUE(),
VALUES('Parameter Trend'[Parameter Trend])="Revenue", [BUD Revenue],
VALUES('Parameter Trend'[Parameter Trend Fields])="Activity 40032 Revenue", [BUD Activity 40032 Revenue],
VALUES('Parameter Trend'[Parameter Trend])="Expenses", [BUD Expenses]*-1,
VALUES('Parameter Trend'[Parameter Trend])="Salaries", [Bud Salaries]*-1,
VALUES('Parameter Trend'[Parameter Trend])="Activity Exp as % of Activity Revenue", [BUD Expenses]*-1,
VALUES('Parameter Trend'[Parameter Trend])="Salaries %", [BUD Surplus],
BLANK()),BLANK())
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@trwatts , there is challenge when we directly check the value. I have used this code to check the selected value

What is selected = maxx(filter('Axis Slicer', 'Axis Slicer'[Axis Slicer Order]= SELECTEDVALUE('Axis Slicer'[Axis Slicer Order])),'Axis Slicer'[Axis Slicer])

 

Check if that is blank means , nothing selected 

 

or try hasonevalue on order column

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@trwatts , there is challenge when we directly check the value. I have used this code to check the selected value

What is selected = maxx(filter('Axis Slicer', 'Axis Slicer'[Axis Slicer Order]= SELECTEDVALUE('Axis Slicer'[Axis Slicer Order])),'Axis Slicer'[Axis Slicer])

 

Check if that is blank means , nothing selected 

 

or try hasonevalue on order column

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

Worked it out. 
Thank you for your help it is greatly appreciated. 🙂

Thanks @amitchandak 
I have tried the order value in the hasonevalue section and havent had any luck. 
Not sure exactly where to drop the formula you gave into the dax?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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