Forum Discussion

tlmf2020's avatar
tlmf2020
Regular Visitor
2 years ago
Solved

Dynamic column value form selected value in parameters

hi everyone,
I have table 

 

 

I created new parameter for keyword and for score like

 

 

Keyword_para = {
("Keyword", NAMEOF('distinc_keyword'[Keyword]), 0)

new_score_para = GENERATESERIES(0, 50, 1)

 

my expectation create new column newScore 

example

when if user select keyword = Random 1 and Score = 25

 

NewScore colum will show

 

 

NewScore colum will show 

 

 

 

when if user select keyword = Random 2 and Score = 30

 

NewScore colum will show

 

I am using formular

newScore =
IF(
Sheet[Keyword] = SELECTEDVALUE('distinc_keyword' [Keyword]),
SELECTEDVALUE ( new_score_para[new-score] ),
Sheet2[Score]
)

but it doesnot work

any helps?

 

 

@MFelix

 

  • Hi tlmf2020 

     Check the attached PBIX which has a working solution.

    Let me know if this is what you are expecting.
    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    Follow me on LinkedIn!!!

  • hi NaveenGandhi ,
    that is very good solution. However I dont know why when we sum value didnot change.
    Do you have any suggestions?

     

  • tlmf2020 

    Just update the measure as below.

    New Score =

    VAR SelectedKeyword = SELECTEDVALUE(Keyword_para[Keyword])
    VAR TableKeyword = SELECTEDVALUE('Table'[Keyword])
    VAR IndividualScore = SELECTEDVALUE(Score[Score])
    VAR NewScore = IF(SelectedKeyword = TableKeyword, IndividualScore, SUM('Table'[Score]))
    RETURN
    IF(
        ISINSCOPE('Table'[Keyword]),
        NewScore,
        SUMX('Table', IF(SelectedKeyword = 'Table'[Keyword], IndividualScore, 'Table'[Score]))
    )
    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    Follow me on LinkedIn!!!
  • thanks NaveenGandhi ,
    it work, very nice solutions.
    now my case have situation
    what total change if  we select multiple keys and change multiple score,
    for example if we select all keywords with corresponding score

    expectation for output

     

     

     

    if we select

     

     

     

     

     

    any helps?

     

  • tlmf2020's avatar
    tlmf2020
    2 years ago

    excellent solutions NaveenGandhi , Really appriciate your help
    I am new with this community, thanks for let me know that I need to accept the solution.

  • tlmf2020's avatar
    tlmf2020
    2 years ago

    hi NaveenGandhi ,
    in the case we have fix keys how formular to calcualte new Scorce?

    I cannot attached ppx file here. so I've send you via LinkedIn.
    Hope you can help me to do it today.

    thank you so much for your helps

8 Replies

  • NaveenGandhi's avatar
    NaveenGandhi
    Memorable Member

    Hi tlmf2020 

     Check the attached PBIX which has a working solution.

    Let me know if this is what you are expecting.
    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    Follow me on LinkedIn!!!

    • tlmf2020's avatar
      tlmf2020
      Regular Visitor

      hi NaveenGandhi ,
      in the case we have fix keys how formular to calcualte new Scorce?

      I cannot attached ppx file here. so I've send you via LinkedIn.
      Hope you can help me to do it today.

      thank you so much for your helps

  • tlmf2020's avatar
    tlmf2020
    Regular Visitor

    hi NaveenGandhi ,
    that is very good solution. However I dont know why when we sum value didnot change.
    Do you have any suggestions?

     

    • NaveenGandhi's avatar
      NaveenGandhi
      Memorable Member

      tlmf2020 

      Just update the measure as below.

      New Score =

      VAR SelectedKeyword = SELECTEDVALUE(Keyword_para[Keyword])
      VAR TableKeyword = SELECTEDVALUE('Table'[Keyword])
      VAR IndividualScore = SELECTEDVALUE(Score[Score])
      VAR NewScore = IF(SelectedKeyword = TableKeyword, IndividualScore, SUM('Table'[Score]))
      RETURN
      IF(
          ISINSCOPE('Table'[Keyword]),
          NewScore,
          SUMX('Table', IF(SelectedKeyword = 'Table'[Keyword], IndividualScore, 'Table'[Score]))
      )
      If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

      Follow me on LinkedIn!!!
  • tlmf2020's avatar
    tlmf2020
    Regular Visitor

    thanks NaveenGandhi ,
    it work, very nice solutions.
    now my case have situation
    what total change if  we select multiple keys and change multiple score,
    for example if we select all keywords with corresponding score

    expectation for output

     

     

     

    if we select

     

     

     

     

     

    any helps?

     

    • NaveenGandhi's avatar
      NaveenGandhi
      Memorable Member

      tlmf2020 

      I have done it for 2 keywords&scores, You replicate it for others.

      If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

      Follow me on LinkedIn!!!

      • tlmf2020's avatar
        tlmf2020
        Regular Visitor

        excellent solutions NaveenGandhi , Really appriciate your help
        I am new with this community, thanks for let me know that I need to accept the solution.