Forum Discussion

Akash_Varuna's avatar
Akash_Varuna
Super User
1 year ago
Solved

Issue With Relationship / DAX Not Showing Correct Data

Hi all, I’m facing an issue and I’d really appreciate any suggestions or sample approaches. Data Sources and Tables Topics → from SharePoint Excel (via Dataflow) Messages → from Azure...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Akash_Varuna ,

    Thank you for reaching out to the Microsoft fabric community forum. Also thank you wardy912 for you helful response.

     

    The behavior you observed is due to the way SELECTEDVALUE works; it only returns a single value when there is one value in the current filter context. When a conversation_id is associated with multiple topic_labels, the function will either return one value or blank, which is why you were not getting the expected results.

     

    To address this, you can use CONCATENATEX instead, which will return all topic groups linked to the selected conversation, separated by commas: 

     

     

    Topic Groups = 
    CALCULATE (
        CONCATENATEX (
            VALUES ( Topics[topic_group] ),
            Topics[topic_group],
            ", "
        ),
        TREATAS ( VALUES ( Messages_1[topic_label] ), Topics[topic_label] )
    )
    

     

     

    Please find the attached .pbix and test it in your environment. You should now see multiple topic groups correctly displayed whenever a conversation_id maps to more than one label.

    Hope this helps, please feel free to rech out for any further questions.

     

    Thank you.