Forum Discussion
How to filter data from date table and another table?
- 2 years ago
Hey hani1711 ,
at a first glance I can not see what is not working, except that the measure seems too complicated.
If the slicers of year, month, day are derived from the DimDate table you can get the
var _selecteddate
like so:var _selecteddate = maxx(values(DimDate[FullDateAlternateKey]), DimDate[FullDateAlternateKey])I use the table iterator function MAXX in case the slicers allow multi-selection.
In the CALCULATE I would use this:CALCULATE( [Qty] ,ALL(DimDate) ,DATESBETWEE(DimDate[FullDateAlternateKey],_mindate ,_selecteddate) ,table[Type] IN {"Negative Adjmt.", "Consumption"} )If this does not help to tackle your challenge, consider creating a pbix file that contains sample data but reflects your semantic model (tables, relationships, calculated columns, and measures), upload the pbix file to OneDrive, Google Drive, or Dropbox and share the link.
Do not forget to describe the expected result based on the sample data you provide.Regards,
Tom
Hey hani1711 ,
at a first glance I can not see what is not working, except that the measure seems too complicated.
If the slicers of year, month, day are derived from the DimDate table you can get the
var _selecteddate
like so:
var _selecteddate = maxx(values(DimDate[FullDateAlternateKey]), DimDate[FullDateAlternateKey])
I use the table iterator function MAXX in case the slicers allow multi-selection.
In the CALCULATE I would use this:
CALCULATE(
[Qty]
,ALL(DimDate)
,DATESBETWEE(DimDate[FullDateAlternateKey],_mindate ,_selecteddate)
,table[Type] IN {"Negative Adjmt.", "Consumption"}
)
If this does not help to tackle your challenge, consider creating a pbix file that contains sample data but reflects your semantic model (tables, relationships, calculated columns, and measures), upload the pbix file to OneDrive, Google Drive, or Dropbox and share the link.
Do not forget to describe the expected result based on the sample data you provide.
Regards,
Tom