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
nirupreddy
7 years agoFrequent Visitor
Thank You MFelix,
I do get what you are saying but my previous year calculation is not that simple as we have to take leap year and 53 weeks into consideration. So its not possible to calculate on the fly. Hence i have pre poulated in my dimension
MFelix
Super User
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
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