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
arq52
Frequent Visitor

How to replace SELECTCOLUMNS in a DAX query ?

Hi experts,

After several search at home, I've been able to write the following DAX code to calculate loads per quarter per item and step. It works and gives me the expected results.

But back to my office it didn't work. Thanks to the error message, I realized that "SELECTCOLUMNS" does not exist on excel 2013 !

I don't find yet the way to replace this fonction ; could you help me ?

Thanks by advance.

 

EVALUATE
SELECTCOLUMNS(
    FILTER(
        CROSSJOIN(ProcessSheet, ForecastPerProgram),
        ProcessSheet[program]=ForecastPerProgram[program]
    ),
    "program", ProcessSheet[program],
    "YYYYQQ", RELATED(quarters[YYYYQQ]),
    "load", [load],
    "item", ProcessSheet[item],
    "step", ProcessSheet[step],
"WorkCenter", ProcessSheet[WorkCenter] )
  • [load] is a mesure =AVERAGE(ProcessSheet[LoadPerUnit])*AVERAGE(ForecastPerProgram[QtyPerQuarter])
  • ProcessSheet is a table which gives the time ("LoadPerUnit") needed to produce one item for each step on associated workcenter. At each item is associated a program
  • ForecastPerProgram is a table which gives forecasts per program and per quarters

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi arq52 ,

 

You can use summarize() or addcolumns() to replace selectcolumns.

Please refer to: https://msdn.microsoft.com/en-us/query-bi/dax/addcolumns-function-dax and 

https://msdn.microsoft.com/en-us/query-bi/dax/summarize-function-dax

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi arq52 ,

 

You can use summarize() or addcolumns() to replace selectcolumns.

Please refer to: https://msdn.microsoft.com/en-us/query-bi/dax/addcolumns-function-dax and 

https://msdn.microsoft.com/en-us/query-bi/dax/summarize-function-dax

 

Regards,

Jimmy Tao

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.