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?
Solved! Go to Solution.
I made one sample for your reference. If it doesn't meet your requirement, kindly share your sample data and excepted result to me.
Measure = CALCULATE ( SUM ( Table1[Column2] ), FILTER ( Table1, Table1[Column1] = MAX ( Table2[Column1] ) ) )
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Both My tables are related. To be more specific I have my fact table that has YYYYWW = year*100+week, year and week as columns and few measures.
And My date dimension has following columns
YYYYWW = year*100+week,quarter,period, starting date of week, ending date of week, and a column LY_YYYYWW that gives a 52 weeks earlier (year*100 + week) value
And i am trying to get this years measure and 52 weeks earlier measure to compare aginst.
I can't use time intelligence functions as this is a custom calendar.
So, i am trying
measure_ly = CALCULATE ( expression, table.YYYYWW = tableb.LY_YYYYWW)"
is it possible.
Thank you for the response. I want to to avoid that caluclation as i already have that value in tableB as LY_YYYYWW and want to use this column.
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
in this instance, it is retrieving max minus 30 for total sales. Make sure that your tables has cardinality.
Dates[Date] > MAX(Dates[Date])-30))
Click here to learn more about the September 2022 updates!
Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.
Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!