cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
savvari Frequent Visitor
Frequent Visitor

DAX query to import data with filter on a numeric column in the fact table

I'm importing data from Tabuar OLAP using a DAX query. But I want to filter on a column from the central fact table which has numberic values - 1 and 0

 

Evaluate(
FILTER(ADDCOLUMNS(
SUMMARIZE(
'FactTable',

'FactTable'[Col1],

'DateDim'[Col2],

'FactTable'[Col3],

-----------

-----------

-----------
),--Summarize end
"MeasureName", CALCULATE(SUM ( 'FactTable'[Col4] ))
), --Add columns end
VALUE(''DateDim'[Col2])>=1/1/2017 &
('FactTable'[NumCol5])=0 -- It is this condition which is giving me error (A single value for column cannot be determined.) I tried using Max and Sum but the query isn't resulting any rows.
) -- filter end
) -- evaluate end

 

How do I filter on the column with numeric value from the fact table? I want to get only the rows with NumCol5 value as 0.

2 REPLIES 2
Community Support Team
Community Support Team

Re: DAX query to import data with filter on a numeric column in the fact table

Hi @savvari,

 

DAX in the tabular SSAS is still DAX. There are some errors in your DAX formula. 

1. No [NumCol5] that can be filtered due to it doesn't exist in the first parameter of FILTER.

2. The & should be &&.

Please refer to the formula below to adjust yours.

 

Evaluate(filter(
ADDCOLUMNS(
SUMMARIZE(
'FactTable',
'FactTable'[Col1],
'FactTable'[Col2],
'FactTable'[Col3],
'FactTable'[col5]
),
"MeasureName", CALCULATE(SUM ( 'FactTable'[Col4] ))
), [col2] >=date(2018, 1,1)&&[col5]=0));

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Support Team
Community Support Team

Re: DAX query to import data with filter on a numeric column in the fact table

Hi @savvari,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.