cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Conditional Replace Value across table (multiple rows/columns) for values greater than 1

Seeking help in figuring out a query that will replace all values greater than 1 with 1

 

see attached screenshotQuery replace.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Conditional Replace Value across table (multiple rows/columns) for values greater than 1

Hi,

 

Please try to add custom columns in Query Editor:

71.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

4 REPLIES 4
Highlighted
Super User IX
Super User IX

Re: Conditional Replace Value across table (multiple rows/columns) for values greater than 1

Create new columns

Category 1 new =if(table[Category 1 ]>1,1,0)

Category 2 new =if(table[Category 2 ]>1,1,0)

Category 3 new =if(table[Category 3 ]>1,1,0)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Frequent Visitor

Re: Conditional Replace Value across table (multiple rows/columns) for values greater than 1

@amitchandak - not practicable as columns can vary (15-25) from source data. currently has 15 columns. I'd rather transform the the data in edit query within existing columns

Highlighted
Super User IX
Super User IX

Re: Conditional Replace Value across table (multiple rows/columns) for values greater than 1

You can do while doing some calculation like

 

New Measure = Sumx(table,if(table[category]>1,1,0))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Conditional Replace Value across table (multiple rows/columns) for values greater than 1

Hi,

 

Please try to add custom columns in Query Editor:

71.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors