Forum Discussion
DAX Query Help!
Hi GuestUser ,
try this.
Forecast Quantity = SUMX(FILTER('Fact-Forecast','Fact-Forecast'[article_desc] = RELATED('Dim-Item'[item_description])), 'Fact-Forecast'[forecast])
Thanks mwegener
I guess i was not clear before..
But the value isn't matching . Actually when i applied the DAX formula provided , the data is equivalent to below sql query (
filter of month in subquery)
select sum (f.forecast)
from
fact-forecast f,
dim-item d,
dim-date date
where
f.item_id = d.id
and f.date_wid = date.id
and date.month = 'April-2020'
and i.item_description in
(select distinct f.article_desc
from
fact-forecast f
where date_wid = '0420'
);
But i need DAX expression for below sql query
Should not take the month filter in the subquery.
Ideally the data in the table is such a way that for same item_wid - item description is different in dimension and fact table
Can you pls suggest?
select sum (f.forecast)
from
fact-forecast f,
dim-item d,
dim-date date
where
f.item_id = d.id
and f.date_wid = date.id
and date.month = 'April-2020'
and i.item_description in
(select distinct f.article_desc
from
fact-forecast f);
- mwegener6 years ago
Most Valuable Professional
- GuestUser6 years ago
Helper V
Pls find below proper query:
select sum (f.forecast)
from
fact-forecast f,
dim-item d,dim-date date
where
f.item_id = d.idand f.date_wid = date.id
and date.month = 'April-2020'
and d.item_description in
(select distinct f.article_desc
from
fact-forecast f);