dax for dynamic difference calculations.
2 TopicsDelta vs AVG for each row
Hi guys, I am trying to understand how DAX works, still fighting with that (I am not strong in contexts but I understand it little bit so please take patient ) I have following table Char Value Avg per group A 1 2 A 3 2 B 2 5 B 8 5 C 1 50 C 99 50 And my goal is to get new column which will compare current value vs avg for current group (see latest column in right) Char Value Avg per group Delta from average per group A 1 2 -1 A 3 2 1 B 2 5 -3 B 8 5 3 C 1 50 -49 C 99 50 40 I tried to use "DELTA = sumx(Avg per group - Values(Value))", context is empty, because it should be evaluated against table above.., I understand that some row context should be used to iterate calculation for each row, but dont t know the formula.. any ideas how to fix it and why it is not working? thank you in advanceSolved1.1KViews0likes5CommentsDAX for difference between each value (km) and its previous value (km) per selection
Hi, Please help? I really struggle to create dax to accomplish the following: For each vehicle many jobs are performed at various mileage intervals. Each time a job is performed, the mileage (Meter KM) is captured. Below in the table you can see the mileage when different jobs in the JOB column were performed at various dates for one selected vehicle. (There are of course many more vehicles.) Question: I don't want to display the actual mileage when each job was performed as you can see in the below table, but rather the difference between each value (km) and its previous value (km) for each job. This is to see clearly the interval in which the jobs were performed. This means e.g. for the first Job 06-02-005, 2021 June should display (147,584-136,011)= 11,573, and for 2022 July (162,981-147,584=) 15,397. All the data is captured in the same WO WITH JOB DETAIL table. Here sample data from this table: Sample dataset . The data captured in Power BI is here. You will note the interval between the various jobs differs. One would typically filter on a specific vehicle to monitor service intervals for its many jobs. With thanks, WaterSolved1.6KViews0likes5Comments