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

How to convert working New Table DAX to addcolumns DAX

I created a “New Table” by clicking on the “Modeling” tab and selecting “New Table.”  I then entered the following DAX, which works with NO issues at all.

LatestFilerGap%Table = ADDCOLUMNS('Filer Capacity', "Latest Filer Gap%", 1-LOOKUPVALUE('Filer Capacity'[Gap%], [date], MAX('Filer Capacity'[date])))

 

However, this adds a whole new table and increases the size to my overall report, which I would like to reduce.  What I really want is to just execute the same “ADDCOLUMNS” DAX formula to my existing ‘Filer Capacity” table but it DOES NOT work.  I have no idea why it does not. If I can create a whole new table why can’t I just add the same information to the existing table“Filer Capacity?”  I want to add column “Latest Filer Gap%” to my existing table “Filer Capacity.”  Any solutions?  I thought this would be straight forward but I cannot figure it out. Or is the way that I made it work, by creating a whole new table based on my existing “Filer Capacity” table, the only way to go?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

So you are saying that this in a calculated column does not work?

 

1-LOOKUPVALUE('Filer Capacity'[Gap%], [date], MAX('Filer Capacity'[date]))

 

Do you get an error or just the wrong value?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

So you are saying that this in a calculated column does not work?

 

1-LOOKUPVALUE('Filer Capacity'[Gap%], [date], MAX('Filer Capacity'[date]))

 

Do you get an error or just the wrong value?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

As usual, this is what I get for over complicating things.  I tried to use the ADDCOLUMNS, from the DAX that worked, when adding a column to a table that already exists. Sort of double adding a column?  LOL  Thank you very much for your quick response and answer.

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.

Top Solution Authors