Forum Discussion

BenazirMohammad's avatar
5 years ago

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

    • BenazirMohammad's avatar
      BenazirMohammad
      Icon for Helper I rankHelper I

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

       

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

       

    • BenazirMohammad's avatar
      BenazirMohammad
      Icon for Helper I rankHelper I

      Thanks.

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

      {"Last 2 Months"} and the then pulling the Value using SelectColumns.