cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
v-jiascu-msft Super Contributor
Super Contributor

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.
v-jiascu-msft Super Contributor
Super Contributor

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.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 309 members 3,281 guests
Please welcome our newest community members: