cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenazirMohammad
Helper I
Helper I

SELECTCOLUMNS

Hi,

I am fairly new to DAX and came across this line of code which I am unable to understand.

If understand correctly SELECTCOLUMNS take table as first argument. But in the case below {"Last 2 Months"}

doesn't exist. Also, not sure where [Value] is coming from and how its being recognized. Any help would be appreciated.

 

 

DAX:

Tbl =
SELECTCOLUMNS({"Last 2 Months"},"Period",[Value])
 
Result:
Period
----------------
Last 2 Months
-----------------
 
Thanks
5 REPLIES 5
camargos88
Super User III
Super User III

@BenazirMohammad ,

 

You are just creating a table using hard code values....



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

Proud to be a Super User!



Thanks.

I think I get it. Its creating a table using table constructor 

{"Last 2 Months"} and the then pulling the Value using SelectColumns.
 
 
camargos88
Super User III
Super User III

@BenazirMohammad ,

 

What are you trying to do ?

 

SELECTCOLUMNS selects the columns you want to keep from a table, create new headers and/or add some expressions.

 

SELECTCOLUMNS – DAX Guide



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

Proud to be a Super User!



SELECTCOLUMNS({"Last 2 Months"},"Period",[Value])

 

Yes, but in this case neither the table exist nor the [Value] but its still giving me results.

 

2020-12-04 15_43_42-Window.png

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors