The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @nirupreddy,
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] ) ) )
Regards,
Frank
Hi @nirupreddy,
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Regards,
Frank
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @jiglow3501 and @MFelix,
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Felix,
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank 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
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêsin 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))
User | Count |
---|---|
59 | |
58 | |
54 | |
50 | |
33 |
User | Count |
---|---|
165 | |
85 | |
69 | |
47 | |
45 |