Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I was trying to use Earlier function to get a list of current column value but seems not working well. The DAX is
@yishenhui See my article on Mean Time Between Failure (MTBF) which uses EARLIER. You might need to separate out your calculation of the previous date in a separate VAR. Tends to be easier to troubleshoot. You can also use a VAR to grab your current date (Start of Month) using MAX and then skip using EARLIER and just use that VAR instead.
http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
Hi Greg,
I had read your article before and wrote the previous DAX. Thank you.
I have separated calculation with step by step. However, there is an error that it couldn't find the column but actually it does exist and it worked when it was in the nested calculation. You may found it in the commented rows below
User | Count |
---|---|
6 | |
3 | |
3 | |
2 | |
2 |
User | Count |
---|---|
10 | |
3 | |
3 | |
2 | |
2 |