cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ogh_sabyasachi
Helper III
Helper III

How to get distinct values in a html text?

Hi community,

 

I have an html text where I am filtering a collection and getting the list as in the attached screenshot.  Is there any way we can get the distinct values here.  For eg:  we want "HIPAA Rules & Regulations" just appear once.

1 ACCEPTED SOLUTION

Accepted Solutions

You can use the Distinct function to retrieve only the unique values for the FullNameOfCourse column in your filtered expression:

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef' >
<td> Course Name </td>
</tr>" &
Concat(
    Sort(
        Distinct(
            Filter(MyTempCol2, Full_Name in ([@PowerBIIntegration]).Data.Full_Name),
            FullNameOfCourse),
        Result),
    "<tr><td>" & Result & "</td></tr>"
) & "
</table>"

 Hope this helps!

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@ogh_sabyasachi 
I think I know how to help you but I do not want to retype all of the code in your picture.  Please copy and paste your code as text into the forums and I'll make my suggestions.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @mdevaney ,

 

This is the html code I am using.  Hope this is helpful.  Please suggest the solution.  Thanks.

 

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef' >
<td> Course Name </td>
</tr>
" & Concat(Sort(Filter(MyTempCol2, Full_Name in ([@PowerBIIntegration]).Data.Full_Name),FullNameOfCourse),

"<tr><td>" & FullNameOfCourse & " </td></tr>"
) & "
</table>"

You can use the Distinct function to retrieve only the unique values for the FullNameOfCourse column in your filtered expression:

"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" & "<tr style='background-color:#efefef' >
<td> Course Name </td>
</tr>" &
Concat(
    Sort(
        Distinct(
            Filter(MyTempCol2, Full_Name in ([@PowerBIIntegration]).Data.Full_Name),
            FullNameOfCourse),
        Result),
    "<tr><td>" & Result & "</td></tr>"
) & "
</table>"

 Hope this helps!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,716)