delta
4 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.1KViews0likes5CommentsUsing existing data in one column to calculate a delta value in another column with DAX
Hi there So I have a dataset with 2 columns: "Timestamp" and "NumericValue" My objective is to create a new column which uses DAX to calculate the change in NumericValue. It should obviously start off with the earliest timestamp date and calculate based off previous value in NumericValue. As new numbers are added continously the logic should be generic and work automatically. To give context i want to calculate the change of water consumption coming from an IoT water sensor only providing the meter (accumulated total consumption) My table "Measurements" with examples: | Timestamp | NumericValue | Delta_Value | |--------------- |------------------|---------------| | 2024-01-01 | 0 | 0 | | 2024-01-02 | 10 | 10 | | 2024-01-03 | 15 | 5 | | 2024-01-04 | 16 | 1 | etc etc I have tried a lot including chatgpt suggestions, but it doesn't really work. I made with work in Javascript, but i really want it to work using DAX Thank you!952Views0likes4CommentsDAX Delta Issue - Difference Between Dates Not Working When Amount is Zero for Maximum Date Selected
I am trying to accurately calculate the difference in the amount sold between the most recent date selected and the oldest one. I used a DAX formula to create my Delta, and when calculating the difference between dates, my Delta works for most scenarios. However, there are cases where the measure is not working, specifically when we have 0 for the maximum date and a positive value > 0 for the minimum date. Here is the DAX I am using for my Delta, in my Measure: Diff = IF ( HASONEVALUE ( Table[Snapshot_Date] ), ( ( SUM(Table[Orders]) ) ), CALCULATE ( ( SUM(Table[Orders])), FILTER ( Table, Table[Snapshot_Date] = MIN ( ( Table[Snapshot_Date] ) ) ) ) - CALCULATE ( ( SUM(Table[Orders])), FILTER ( Table, Table[Snapshot_Date] = MAX ( ( Table[Snapshot_Date] ) ) ) ) ) The screenshot below shows that my Delta works perfectly when calculating the difference for the selected dates and rows below. Here follows one example where my measure is not working, where I have 0 for the maximum date and a positive value > 0 for the minimum date: For the highlighted row, the delta should be -0.1 instead. All other rows in this matrix are making sense. Can someone please help me out with this issue? Thank you 🐾1.1KViews0likes3CommentsMeasure to calculate delta between selected planning version
Hi all, I'm trying to create a measure that will calculate the delta between selected planning version. My simplified datamodel is as follows: Version value Planning_1 10 Planning_2 20 Planning_3 25 Planning_4 8 Result should be usable in a matrix visual: column1: planning version A column2: planning version b column 3: delta Thanks you very much for your respons! Regards, Paul TheunissenSolved1.6KViews0likes7Comments