Forum Discussion

Kalachuchi's avatar
Kalachuchi
Helper III
5 years ago
Solved

Dyanmic Commentary

so I have multiple var that calculates

 

_bago2019 = CALCULATE(COUNTX(SUMMARIZE('Table', 'Table'[ClassNumber],'Table'[SerialNumber],'Table'[DeliveryP],'Table'[Status]),'Table'[Status]),FILTER('Table','Table'[Year)] = "2019"&&'Table'[Status]="Bago")

_2019Break

_2019Cont

_2019Not

 

_bago2019 & "new students adopted;" & _2019Cont & "continue students adopted;" &_2019Not & "stopped students adopted." &_2019Break & "break students adopted."
 
I want it to be dynamic, by also changing ; to a . (after the word adopted) when it's only showing 1 or 2?
 
 
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Kalachuchi ,

    Please try to create a measure as below and check whether it can get your expected result:

    Measure =
    IF ( [_bago2019] = 0, BLANK (), [_bago2019] & " new students adopted;" )
        & IF ( [_2019Cont] = 0, BLANK (), [_2019Cont] & " continue students adopted;" )
        & IF ( [_2019Not] = 0, BLANK (), [_2019Not] & " stopped students adopted." )
        & IF ( [_2019Break] = 0, ".", [_2019Break] & " break students adopted." )

    If the above one is not applicable for your scenario, please provide some sample data and expected result with examples and screenshots. Thank you.

    Best Regards

3 Replies

  • Kalachuchi ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

    • Kalachuchi's avatar
      Kalachuchi
      Helper III

      so if the result from the calculate function gets 0 the commentary for that specific variable shouldn't show.

      Basically _bago2019 & "new students adopted;" & _2019Cont & "continue students adopted;" &_2019Not & "stopped students adopted." &_2019Break & "break students adopted." is a concatenated string

       

      if two variables got zero instead of ; we will use . at the end

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Kalachuchi ,

        Please try to create a measure as below and check whether it can get your expected result:

        Measure =
        IF ( [_bago2019] = 0, BLANK (), [_bago2019] & " new students adopted;" )
            & IF ( [_2019Cont] = 0, BLANK (), [_2019Cont] & " continue students adopted;" )
            & IF ( [_2019Not] = 0, BLANK (), [_2019Not] & " stopped students adopted." )
            & IF ( [_2019Break] = 0, ".", [_2019Break] & " break students adopted." )

        If the above one is not applicable for your scenario, please provide some sample data and expected result with examples and screenshots. Thank you.

        Best Regards