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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Line values is not correct with the if dax from slicer value

Could someone help why the line value function is not working with the selectedvalue in the slicer. 

Have a slicer Fund Type with the options below. Using a card with DAX 

Select Fund Type = selectedvalue('Fund Type'[Fund Type],"NF") is displaying correctly and the Avg card is display correctly.
However assigning the Avg to the line is always evaluating to 20
 
Avg = if(selectedvalue('Fund Type'[Fund Type],"NF") = "NF",50000,200)
This is a snapshot when no  Fund Type Industry is selected and the Avg card is showing 50K but the Avg in the chart is showing 200 . It is always showing 200 in the chart irregardless of the value in the Avg card. 
chinxenia_0-1645695323362.png

 

1 ACCEPTED SOLUTION
Russell-PBI
Resolver II
Resolver II

Hi @Anonymous, you have Fund Type as your legend, which might be stopping your measure from evaluating as TRUE.

View solution in original post

6 REPLIES 6
v-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

I am so glad to hear that you have solved your problem , please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards

Community Support Team _ Ailsa Tao

Anonymous
Not applicable

It did not work unless the column series Fund Type is remove. Found a way around it where the slicer is at the Fund Type table ( containing a list of distinct values) and the coumn series is at the table row level. Thank you so much for your help

Anonymous
Not applicable

Needed to have column series of fund type and need to calculate the average in the line depending on the fund type selected. If none is selected then it is average of all fund types. Hope that clarify the context on the goal

Hi @Anonymous, does this work?:

 

Avg = 
IF(
     CALCULATE(
          DISTINCTCOUNT('Fund Type'[Fund Type])
     ,    ALLSELECTED('Fund Type'[Fund Type])
     ) > 1
,    50000
,    200
)

 

Anonymous
Not applicable

Needed the fund type in the column series to depict the different colour of the fund type. Is there a way to based only on selected value.

Russell-PBI
Resolver II
Resolver II

Hi @Anonymous, you have Fund Type as your legend, which might be stopping your measure from evaluating as TRUE.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors