Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

How to create measure to get values clustered

Dear All, 

 

I have a table (Dim Notification), covering  complaints, with two columns ('Status' and 'Type').

Power_BI_Adapt_0-1678289041539.png

Power_BI_Adapt_1-1678289069636.png

 

From these two columns I want to start clustering the values of the fields in one measure (if another solution is better, please let me know).

 

I want to create a measure called 'non-complaint' to cluster complaints and non-complaoints and should contain the values 'Cancel' (from column 'Status') en the values 'Alpha : Algemene klacht' and 'Alpha: Alarm veroorzaakt' (from column 'Type'). When it contains one of the following three values, it should be YES, otherwise NO.

 

Any solution to help me out here, is welcome.

 

Kind regards

2 ACCEPTED SOLUTIONS
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1678342413282.png

(2) We can create two measures.

 

 

type & status = CONCATENATE (
    MAX('Table'[Status]),
    CONCATENATE ( " ", MAX('Table'[Type] ))
)
yes/no = var a={"Cancel","Alpha : Algemene klacht","Alpha: Alarm veroorzaakt"}
return IF(COUNTROWS(FILTER(a,CONTAINSSTRING([type & status],[Value])))>0,"Yes","No")

 

 

(3) Then the result is as follows.

vtangjiemsft_0-1678342607706.png

Please refer to the following document for more information.

Concatenate Data in Power BI with the DAX CONCATENATE Function (mssqltips.com)

 

You can also use Power Query . Select each column in order you want them concatenated, then click Merge columns on the Add Column tab in Power Query Editor.

vtangjiemsft_1-1678343144074.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hi @Anonymous ,

 

Due to the limitations of slicers, placing measures on slicers is not supported, so you can only filter through visual filters.

vtangjiemsft_0-1678862850062.png

Or you can create a column.

 

Column = var a={"Cancel","Alpha : Algemene klacht","Alpha: Alarm veroorzaakt"}
return IF(COUNTROWS(FILTER(a,CONTAINSSTRING([type & status],[Value])))>0,"Yes","No")

 

vtangjiemsft_1-1678863027879.png

Best Regards,

Neeko Tang

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

4 REPLIES 4
Anonymous
Not applicable

Thanks for this suggestions, which seems to work to identify 'real' complaints and non-complaints.

 

However it seems I cannot use the newly created measure 'yes/no' in a slicer to help to make the selection. Am I correct or do I misunderstand something?

 

Thanks in advance for any suggestion.

Anonymous
Not applicable

And in addition: when I use the field / measure 'yes/no' in a tabel, it does only show the value 'no', where I expected both 'yes'and 'no'.

Hi @Anonymous ,

 

Due to the limitations of slicers, placing measures on slicers is not supported, so you can only filter through visual filters.

vtangjiemsft_0-1678862850062.png

Or you can create a column.

 

Column = var a={"Cancel","Alpha : Algemene klacht","Alpha: Alarm veroorzaakt"}
return IF(COUNTROWS(FILTER(a,CONTAINSSTRING([type & status],[Value])))>0,"Yes","No")

 

vtangjiemsft_1-1678863027879.png

Best Regards,

Neeko Tang

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

v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1678342413282.png

(2) We can create two measures.

 

 

type & status = CONCATENATE (
    MAX('Table'[Status]),
    CONCATENATE ( " ", MAX('Table'[Type] ))
)
yes/no = var a={"Cancel","Alpha : Algemene klacht","Alpha: Alarm veroorzaakt"}
return IF(COUNTROWS(FILTER(a,CONTAINSSTRING([type & status],[Value])))>0,"Yes","No")

 

 

(3) Then the result is as follows.

vtangjiemsft_0-1678342607706.png

Please refer to the following document for more information.

Concatenate Data in Power BI with the DAX CONCATENATE Function (mssqltips.com)

 

You can also use Power Query . Select each column in order you want them concatenated, then click Merge columns on the Add Column tab in Power Query Editor.

vtangjiemsft_1-1678343144074.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.