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

Move cell values to the right based on a specific criteria

I had a macro in Excel that could do this, but trying to figure out how I can do this in Power Bi 

 

If column E (Subscription) = "Quarterly" and column H (product_component_name) = "Minimum" then shift cell values by 3 in that row to the right within Column Ranges (M to AL)

 

This was my macro:

Sub ActiveSheet()
Dim c As Range
For Each c In Range("D2: D" & Cells(Rows.Count, 4).End(xlUp).Row) 

If Trim(c.Value) = "Quarterly" And Trim(c.Offset(, 4).Value) = "Min" Then c.Offset(, 8).Resize(, 4).Insert Shift:=xlToRight
Next c
End Sub

 

Also looking for advice if Dax is the correct way to go about this. 

 

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors