Forum Discussion
Need help for generating raw wise difference from column using DAX or power query
- 1 year ago
Hi again
Please try ask the right question first time, because it is a bit annoying having to answer twice 😀😀😀
Click here to download a solution ftom one drive
This method will work for 25 machines or more
Please will you now click [thumbs up] and [accept solutoon button]. Thank you !
How it works ...
For the date correctly
Select the Date and Shift columns, then Transform> Unpiciot>Unpivot other columns
Sort by Machine, Date and Shift
Add an index column from 0 incrementing by 1
Get the machine and reading for the previous row
Change reading to numeric data types
and add a conditional columnRenove the unneeded columns and change the usage ro a numeric data type
Draw your graph
In the attached workbook we have:
- Your source data top left
- A pivot created from a Power Query transform of your source data
- A chart of that pivot.
You will also notice next to your source data, a column E for a Machine C. This data isn't included in the pivot and chart because it's not currently part of your source data.
However, dragging the grab-handle bottom right of your data so that column E does become part of the source data table, then refreshing the pivot table yields the following:
Note:
I noticed what appears to be an anomaly with your source data where the dates/shifts seem to be out of order:
The 1st shift on the 27th May seems to take place after the 1st Shift on the 28th May. Consequently, there's a step in my query which sorts on the stroks count which really shouldn't be there.