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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
U156531
Helper III
Helper III

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

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
v-binbinyu-msft
Community Support
Community Support

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?

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

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 III
Helper III

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!

Proud to be a Super User!





How do I change the value directly in the visual?

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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