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
tctrout
Resolver III
Resolver III

GENERATESERIES[Value] reference

Hello,  

 

I have a base question where I would like to know why I cant 'qualify' the table name for the column [Value] that is created i the GENERATESERIES() measure.  See the below example.  

 

I find it confusing to only refer to [Value] and prefer to qualify it with the table name first.

 

//This DAX Works

TableTest =
var SeriesTest = GENERATESERIES(1,10,1)

var AddColumnTest =
ADDCOLUMNS(SeriesTest
                             ,"ColumnAdd"
                            ,[Value])  //However, why cant this be referred to as SeriesTest[Value]

return
AddColumnTest
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Because SeriesTest is a name for a variable, not for a table. The table created by the function is anonymous.

Best
D

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Because SeriesTest is a name for a variable, not for a table. The table created by the function is anonymous.

Best
D

Ah, thank you, I forgot that when used in a variable the table doenst actually 'materialize'.  I confirmed, once 'materialized', I can qualify it in another calculated table:

 

TableTest2 =
ADDCOLUMNS(TableTest,"ColumnAdd2",TableTest[Value])
 
I do have a follow up, and not sure of the scenario, but what if the DAX requires multiple GENERATESERIES()?  How will it know which [Value]?  Or will it not allow me, and the work around would be to nest another return with a new var GENERATESERIES()?  
Anonymous
Not applicable

// Easy enough to check...
// This gives you an error:

EVALUATE
	CROSSJOIN(
		GENERATESERIES(1, 10, 2),
		GENERATESERIES(2, 10, 2)
	)

// You can do this instead:
EVALUATE
	CROSSJOIN(
		GENERATESERIES(1, 10, 2),
		SELECTCOLUMNS(
			GENERATESERIES(2, 10, 2),
			"Value2", [Value]
		)
	)

 

Best

D

Thank you, makes sense, I'll be keeping this in my back pocket.

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