-1

I created a table using SUMMARIZECOLUMNS in dax studio.It works. But when I added the table in my SSAS tabular cube using tabular editor by right click add a calculated table. When I copy the code in the Expression editor and validate. The table is created but with no columns ? What do I need to do to add the columns ? Code below, I'm suppose to have 3 columns but nothing.

SUMMARIZECOLUMNS (
'Client Date'[Month],    
'Client Date'[Year],    
FILTER ('Client Date','Client Date'[Date]=MONTH(NOW())),
"Buy", [Count Sales]
)
ORDER BY 'Client Date'[Year]

If someone understand ? on dax studio it is working.

Thanks

1
  • Solved, I had an order by; once removed columns were showing
    – Linus
    Commented Apr 20 at 17:36

1 Answer 1

0

I am glad you solved your problem. I am adding this answer to explain why it worked when you removed the ORDER BY.

The ORDER BY clause is not necessary in the calculated table expression, as SSAS Tabular models don’t store the data with an inherent order. You can sort the columns in the model later.

As improvement, I would go for :

ADDCOLUMNS (
    FILTER (
        'Client Date',
        'Client Date'[Date] = MONTH ( NOW() )
    ),
    "Month", 'Client Date'[Month],
    "Year", 'Client Date'[Year],
    "Buy", [Count Sales]
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.