Amazing technique Antriksh. Thanks for sharing this amazing video.
@AntrikshSharma3 жыл бұрын
Thanks!! :)
@mudassirsyedrashidali97873 жыл бұрын
"Filtering should come from the DAX code, not from the slicer." Amazing work here!!
@AntrikshSharma3 жыл бұрын
Thanks bro!!
@tarun353 жыл бұрын
Thank you so much Antriksh
@qasimjan52583 жыл бұрын
Thank you so much Antriksh Sharma.
@Pooja-pd1ee3 жыл бұрын
Great work here. However, I think the code could be optimized a bit. Physical relations in data model performs better than that in dax so, I might have created an inactive relationship between the two as many to one with many side being the original calendar/date table. And, would have written the code something like: Previous year's 3 months' data = var _date = MAX('Calendar'[Date]) var _p3m = CALCULATETABLE ( SAMEPERIODLASTYEAR('Calendar (copy)'[Date]), DATESINPERIOD('Calendar (copy)'[Date],_date,3,MONTH), 'Calendar (copy)'[YearMonthNo] FORMAT(_Date,"yyyy/mm") ) var _result = CALCULATE( [Measure], _p3m, REMOVEFILTERS('Calendar'), KEEPFILTERS('Calendar (copy)'), USERELATIONSHIP('Calendar (copy)'[Date],'Calendar'[Date]) ) return _result
@AntrikshSharma3 жыл бұрын
Thanks! It is true that a physical relationship is orders of magnitude fast but in some case if the values in the filter context are not huge then using TREATAS can optimize the code. In this case the dimension table contain only 2500 rows and I am dealing with 3 values, and this code is super optimized as on a fact table of 12 Million rows it runs in ~39 ms.