Forum Discussion
abhiram342
5 years agoMicrosoft Employee
DAX TRETAS Help
Hi All, I'm facing issue with Treatas function. Can someon please assit. Goal: We want analyze Sales based in "NormalizedSalesDate". I want pass (CountryId) to DimCountryId and Date Key to DimDa...
amitchandak
5 years agoSuper User
abhiram342 , Can you share sample data and sample output in a table format? Or a sample pbix after removing sensitive data.
Try a measure like
measure =
var _tab = distinct(DimNormalizedDate[DateKey])
var _date = distinct(filter(DimDate, DimDate[DateKey] in _tab), DimDate[MonthKey])
return
calculate(sum(Sales[SALES]), filter(Sales,Sales[MonthKey] in _date))
abhiram342
5 years agoMicrosoft Employee
Hi Amit - Thank you for your response. It has sensitive data, hence I have shared sample data.
Below line is not working. Can you please help here
Error: containsrow must have a value for each row
var _date = distinct(filter(DimDate, DimDate[DateKey] in _tab), DimDate[MonthKey])
Thanks,
Abhiram