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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
U156531
Helper V
Helper V

Replace Column A with Column B by referencing the values in the visual not the query.

I have the following results in my Visual. I would like to replace the value in Column A with the value in Column B if Column B is equal to 3. Is there a way to reference the values in the visual without using the query columns that produced the results?

 

Begining with

     ColumnA       ColumnB 

         1                     1

         2                     3  

 

Desired results

     ColumnA       ColumnB 

         1                     1

         3                     3  

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @U156531 ,

You could set the filter condition in the visual filter pane:

Table:

vbinbinyumsft_1-1708934107698.png

 

Before setting:

vbinbinyumsft_0-1708934091477.png

vbinbinyumsft_2-1708934167241.png

 

 

Best regards,
Community Support Team_Binbin Yu
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

8 REPLIES 8
Anonymous
Not applicable

Hi @U156531 ,

So far, to my knowledge, there is no way to achieve it without measure or calculated column, but i suggest you create a measure to achieve it.

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1708583849189.png

2. create a measure with below dax formula

Measure =
VAR _b =
    SELECTEDVALUE ( 'Table'[Column B] )
VAR _a =
    SELECTEDVALUE ( 'Table'[Column A] )
RETURN
    IF ( _b = 3, _b, _a )

3. add a table visual with fields and measure

vbinbinyumsft_1-1708583936944.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, That worked!

If I just want all the rows from both _a and _b in the same column how would I change this statement to accomplish that?

Anonymous
Not applicable

Hi @U156531 ,

You could try to splice them into a string.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This has gotten me close to the solution but now I'm getting a lot of extra rows where the numeric values are blank. I've tried to filter them out by adding a filter to the Filters on this visual pane but it runs out of memory. Is there an enhancement that can be added to your formula that might filter out these extra rows with blank numeric values?

Thanks

Anonymous
Not applicable

Hi @U156531 ,

You could set the filter condition in the visual filter pane:

Table:

vbinbinyumsft_1-1708934107698.png

 

Before setting:

vbinbinyumsft_0-1708934091477.png

vbinbinyumsft_2-1708934167241.png

 

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

U156531
Helper V
Helper V

It looks like this is going to reference the columns in the queries that produced the visual. Is there a method to directly reference the columns in the visual?

bhanu_gautam
Super User
Super User

@U156531 , You can change the value directly in visual but you can create another table using DAX

 

NewColumn = IF([ColumnB] = 3, [ColumnB], [ColumnA])

 

Please accept as solution and give kudos if it helps




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






How do I change the value directly in the visual?

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 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.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors