cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
charleshale Member
Member

DAX in PowerBI wont recognize column header names (that it recognized earlier) !@#$!@#$!

Help! I am about to melt down into a puddle of frustration over something that has to be simple.

 

I have super simple table with measures that used to work prior to a crash.  The table at issue looks like this: (simple!)

 Capture.PNG

Post recovery, I lost my DAX measures for this table.   No problem - they were simple for this part of the model....EXCEPT that now when I go to recreate those measures, DAX no longer recognizes my column headers.  Images below.   What in the world am I doing wrong?

 

Capture3.PNGCapture4.PNG

 

Note: I understand that I could, as a work around, (i) use power query to add the date as a new column, and (ii) define as measures themselves my table's columns (like Event Value and Total Events.   But, alas, I am stubborn and vexed by what I am missing that makes the column headers no longer work for measures.   

 

Additional point: I promoted headers, changed the columns to numbers, etc (m languate below)

 

let
    Source = Csv.Document(File.Contents("C:\Users\Open Use\Local Posts By Ed.csv"),[Delimiter=",", Columns=5, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Event Value", Int64.Type}, {"Total Events", Int64.Type}, {"patch id", Int64.Type}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Changed Type1",{{"patch id", Int64.Type}, {"Month Index", Int64.Type}, {"Date", Int64.Type}, {"Event Value", Int64.Type}, {"Total Events", Int64.Type}})
in
    #"Changed Type"

 

Thank you for any advice!!!

1 ACCEPTED SOLUTION

Accepted Solutions
Vvelarde Super Contributor
Super Contributor

Re: DAX in PowerBI wont recognize column header names (that it recognized earlier) !@#$!@#$!

@charleshale

 

Hi, the problem is in a measure you need to put a aggregation or function.

 

Example

 

Measure= Right(SelectedValue(Table1[Column]))

 

Maybe before the crash of your file  they are calculated columns  not measures.

 

Regards

 

Victor

 




Lima - Peru
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: DAX in PowerBI wont recognize column header names (that it recognized earlier) !@#$!@#$!

@charleshale,

 


let
    Source = Csv.Document(File.Contents("C:\Users\Open Use\Local Posts By Ed.csv"),[Delimiter=",", Columns=5, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Event Value", Int64.Type}, {"Total Events", Int64.Type}, {"patch id", Int64.Type}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Changed Type1",{{"patch id", Int64.Type}, {"Month Index", Int64.Type}, {"Date", Int64.Type}, {"Event Value", Int64.Type}, {"Total Events", Int64.Type}})
in
    #"Changed Type"

 

Thank you for any advice!!!


 

It seems like the column names has been changed in power query(e.g.: change column names, promoted Headers, delete/add columns), have you click apply&close after the last modification in power bi? If you have, modify the column names in the report level and click refresh.

 

Regards,

Jimmy Tao

charleshale Member
Member

Re: DAX in PowerBI wont recognize column header names (that it recognized earlier) !@#$!@#$!

2 things: 

 

1 - The names match the source CSV column names and remain unchanged

2 - I tried changing names and rerunning, and got the same result.

 

I ended up just doing the manual workaround.  If there's nothing obvious I'm doing wrong, I'd say this one smells like a bug that can occur when a file crashes and recovers.

Vvelarde Super Contributor
Super Contributor

Re: DAX in PowerBI wont recognize column header names (that it recognized earlier) !@#$!@#$!

@charleshale

 

Hi, the problem is in a measure you need to put a aggregation or function.

 

Example

 

Measure= Right(SelectedValue(Table1[Column]))

 

Maybe before the crash of your file  they are calculated columns  not measures.

 

Regards

 

Victor

 




Lima - Peru
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




View solution in original post

Community Support Team
Community Support Team

Re: DAX in PowerBI wont recognize column header names (that it recognized earlier) !@#$!@#$!

@charleshale,

 

Could you reporduce this issue using a sample pbix file and share the sample pbix file?

 

Regards,

Jimmy Tao

Helpful resources

Announcements
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