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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Power_BI_Adapt
Resolver I
Resolver I

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 @Power_BI_Adapt ,

 

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 @Power_BI_Adapt ,

 

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
Power_BI_Adapt
Resolver I
Resolver I

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.

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 @Power_BI_Adapt ,

 

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 @Power_BI_Adapt ,

 

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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