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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
VickyDev18
Helper II
Helper II

Field Parameters in Reference Labels in the new Card visual not working

Let's say I have 6 metrics  Sales, COGS, Sales This Year, COGS This Year, Sales Last Year, COGS Last Year. 

 

I want the user to have 2 slicers

1. To choose between Sales or COGS

2. To choose between comparison to "This Year" or "Last Year"

 

If user selects Sales and This Year, the Card visual will show Sales as the main metric and Sales This Year in the reference label area. 

If user selects COGS and Last Year, the Card visual will show COGS as the main metric and COGS Last Year in the reference label area. 

I thought I would be able to achieve this using 2 Field Parameters but looks like Field Parameters don't work for Reference Labels. Is that correct or am I missing something? 

VickyDev18_1-1715601692195.png


Here's a link to a sample PBIX file. 


 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @VickyDev18 ,

 

Currently you cannot use field parameters in the reference or the card since has you can see it will return the first value and not the value itself for this you need to create a switch measure:

Reference = SWITCH( TRUE(),
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  0 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =0 , [Sales This Year],
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  0 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =1 , [Sales Last Year],
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  1 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =0 , [COGS This Year],
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  1 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =1 , [COGS Last Year])

 

See PBIX file attach.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @VickyDev18 ,

 

Currently you cannot use field parameters in the reference or the card since has you can see it will return the first value and not the value itself for this you need to create a switch measure:

Reference = SWITCH( TRUE(),
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  0 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =0 , [Sales This Year],
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  0 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =1 , [Sales Last Year],
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  1 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =0 , [COGS This Year],
    SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  1 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =1 , [COGS Last Year])

 

See PBIX file attach.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks @MFelix . 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.