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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Marvhall
Helper I
Helper I

Suppressing two columns from one columns values.

I have a matrix table set up with IF statements to identify suppression rules. What I need is both columns to be suppressed when column A is supressed. Below is screenshot of what I have vs what I need.

 

Any ideas?

 

What I have  
 Data Column AForAgainst
A971,750
B38532,203
C**1,234
D4587
E**7,024
   
   
What I need  
 Data Column AForAgainst
A971,750
B38532,203
C****
D4587
E****

 

Thanks!

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Marvhall ,

Please have a try.

Create a meausre.

Measure = IF(MAX('Table'[For])="**","**",MAX('Table'[Against]))

Or a column.

Column =
VAR _1 =
    CONVERT ( 'Table'[Against], STRING )
RETURN
    IF ( 'Table'[For] = "**", "**", _1 )

 

vrongtiepmsft_0-1695174249110.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUbI0BxKGOuamBkqxOtFKTkCesYUpiDTSMTIwBgs6A7laWmB1RsYmYCEXIM8EpMzCHMx3hSkx1zEwAiqJBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Data Column A" = _t, For = _t, Against = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,each [Against],each if [For]="**" then [For] else [Against],Replacer.ReplaceValue,{"Against"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Against", type text}})
in
    #"Changed Type"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUbI0BxKGOuamBkqxOtFKTkCesYUpiDTSMTIwBgs6A7laWmB1RsYmYCEXIM8EpMzCHMx3hSkx1zEwAiqJBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Data Column A" = _t, For = _t, Against = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,each [Against],each if [For]="**" then [For] else [Against],Replacer.ReplaceValue,{"Against"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Against", type text}})
in
    #"Changed Type"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".

Anonymous
Not applicable

Hi @Marvhall ,

Please have a try.

Create a meausre.

Measure = IF(MAX('Table'[For])="**","**",MAX('Table'[Against]))

Or a column.

Column =
VAR _1 =
    CONVERT ( 'Table'[Against], STRING )
RETURN
    IF ( 'Table'[For] = "**", "**", _1 )

 

vrongtiepmsft_0-1695174249110.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

@Anonymous 

 

This works when the values are in their own column. See below for column make up.

Marvhall_0-1695214734577.png

 

What I am doing to get your solution is to reference the main table and select these columns, unvpivot Group A, then Pivot on Group A to get them into their own column headings.

 

Thoughts? or do you have a better solution?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.