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
savvari
Helper I
Helper I

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
Employee
Employee

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

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.

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.