Column Names Changing Within DAX Formulas?

leishtheman

New Member
Joined
Oct 1, 2007
Messages
32
Hello

I have an annoying issue whereby column names sometimes change within my DAX formulas by themselves. It appears to be getting caused by a combination of i) their positions in the underlying excel file changing, and ii) my combine files import routine into Power Query. For example if I have a basic DAX formula saying : COUNT(D_Snapshots[Genuine Shortage] where 'Genuine Shortage' is in column F in the underlying Excel table and I then add a new column called 'Type' into column E thus shunting Genuine Shortage into column G, the Dax changes itself to say COUNT(D_Snapshots[Type]).

This is causing my formulas to become incorrect and I've been unable to find a solution. I've tried hard coding columns names, dynamically identifying column index numbers - DAX doesn't like anything like this. Anybody any ideas around how to overcome this?

Thanks in advance
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I have never seen that with DAX. It's a common occurrence with structured reference table formulas though. How/where are you using the DAX formula?
 
Upvote 0
I have never seen that with DAX. It's a common occurrence with structured reference table formulas though. How/where are you using the DAX formula?
I'd never seen it before either until last week. It's bizarre. I've found nothing in google on it and the likes of Chat GPT and Bard are clueless. I'm using the formulas for some basic 'countif' (calculate) measures to feed a few card visuals. A copy paste of one of the affected measures is as follows :
Snapshots_Genuine_Shortage_Count = (calculate(count(D_Snapshots[Genuine Shortage]),D_Snapshots[Genuine Shortage]="Y"))+0

When I added the new Type column to the immediate left of the Genuine Shortage column in the Excel file the measure changed itself to :
Snapshots_Genuine_Shortage_Count = (calculate(count(D_Snapshots[Type]),D_Snapshots[Type]="Y"))+0
 
Upvote 0
I'd never seen it before either until last week. It's bizarre. I've found nothing in google on it and the likes of Chat GPT and Bard are clueless. I'm using the formulas for some basic 'countif' (calculate) measures to feed a few card visuals. A copy paste of one of the affected measures is as follows :
Snapshots_Genuine_Shortage_Count = (calculate(count(D_Snapshots[Genuine Shortage]),D_Snapshots[Genuine Shortage]="Y"))+0

When I added the new Type column to the immediate left of the Genuine Shortage column in the Excel file the measure changed itself to :
Snapshots_Genuine_Shortage_Count = (calculate(count(D_Snapshots[Type]),D_Snapshots[Type]="Y"))+0
I've figured it out (was just getting clouded because the power query transformation is so big) - fields are being renamed in power query after the DAX measures had already been written citing the original names, so the name changes are just cascading to the measures which will usually be the most desirable behaviour, it's not moving column as I'd thought.

Would be great if this could be controlled however (I use the INDIRECT() formula in Excel to alter the native behaviour by way of analogy), as while I now understand what's going on my problem of not being able to get by measures to point at the desired field persists as turns out I want to get the DAX to dynamically point at a desired field..
 
Upvote 0

Forum statistics

Threads
1,215,124
Messages
6,123,187
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top