Linus
Linus

Reputation: 93

Calculated table summarizecolumns

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

Upvotes: -1

Views: 58

Answers (1)

Amira Bedhiafi
Amira Bedhiafi

Reputation: 1

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]
)

Upvotes: 0

Related Questions