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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Can you enter a formula in a column in Power Query Editor?

I want to enter the following formula for each column(after Savings Plan Cost) in my dataset:

 

=IF(Savings Plan Cost < [columnheader], (Savings Plan Cost/0.6)-Savings Plan Cost, ([columnheader]/0.6)-[columnheader])

 

So for example when my column header is 248, the formula should be:

 

==IF(Savings Plan Cost < [248], (Savings Plan Cost/0.6)-Savings Plan Cost, ([248]/0.6)-[248])

 

I have 999+ such columns, how do I change the the values in each column to the formula above.

 

Attached is a screenshot of my dataset with the first 4 columns.example data.PNG

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

This has surely, surely got to be done more efficiently by unpivoting your extreme number of columns and just making one formula based on the value in the column header...

Anonymous
Not applicable

Thanks - how so?

I pivoted the columns because I need to see how the values in the Savings Plan Cost column relate to each other through the formula - so I basically have to compare the column header value to each of the SP Cost values. Any suggestion on improvement of the process is also much appreciated!

Hi @Anonymous 

Any chance of getting some sample data so I don't have to type 1000 columns worth of data.

Thanks

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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