Forum Discussion
nirupreddy
7 years agoFrequent Visitor
How to filter in DAX using another column in a table?
Suppose i have two tables table and tableB in power bi "CALCULATE ( expression, table[column] = value )" In the above DAX can I use tableB[column2] instead of value?
- 7 years agoHi nirupreddy,
Understand your requirements but believe that your setup.is not the most efficient and with bedt options, just a question if you have a leap.year with 53 weeks how does that compare with previous year, to week 52 or week 1 of current year?
However I believe that you date table could be setup in a different way try the following measure:
Measure = CALCULATE (EXPRESSION ; FILTER(ALL(Table[YYYYWW]); Table[YYYYWW] = MAX (Table[LYYYYYWW] ) ))
Not on computer so didn't try it but should work.
Regards
MFelix
jiglow3501
7 years agoFrequent Visitor
in this instance, it is retrieving max minus 30 for total sales. Make sure that your tables has cardinality.
30Day =
CALCULATE([Total Sales],
FILTER(ALL(Dates),
Dates[Date] > MAX(Dates[Date])-30))