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
jayantatra
Frequent Visitor

Parameter value is not populated correctly in new table using new column

I have defined a new parameter as below.

FG = GENERATESERIES(0, 100, 0.1)
FG Value = SELECTEDVALUE('FG'[FG])
 
However I am trying to call this value in another table using switch function, but the value shown is blank.
Column in another table : 
FG Value = SWITCH(TRUE(), CALCULATE(VALUES('Input data'[key new]))="Finished goods",'FG'[FG Value],1)
1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @jayantatra ,

 

Here I suggest you to create a measure instead of a calculated column in your data table. Power BI doesn't support us to show dynamic results catched by SELECTEDVALUE() function in calculated column, so it will return blank.

Measure:

M_FG Value =
SWITCH (
    TRUE (),
    CALCULATE ( MAX ( 'Input data'[key new] ) ) = "Finished goods", 'FG'[FG Value],
    1
)

Result is as below.

vrzhoumsft_0-1686105714927.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @jayantatra ,

 

Here I suggest you to create a measure instead of a calculated column in your data table. Power BI doesn't support us to show dynamic results catched by SELECTEDVALUE() function in calculated column, so it will return blank.

Measure:

M_FG Value =
SWITCH (
    TRUE (),
    CALCULATE ( MAX ( 'Input data'[key new] ) ) = "Finished goods", 'FG'[FG Value],
    1
)

Result is as below.

vrzhoumsft_0-1686105714927.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

One more request pertaining the post, can it be converted to column somehow, as the calculation of totals is not done correctly in measure

.

 

Thank You @v-rzhou-msft , it is working perfectly 

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.