Forum Discussion
Show changes in price
- 6 years ago
Hi Anonymous ,
I have updated the file here.
The measure for 'delta compared to last week' is this:
LastWeek = VAR _curYearWeek = SELECTEDVALUE(DateTable[yearweek]) RETURN SWITCH(TRUE(), CALCULATE(MAX(Table3[Price]), DateTable[yearweek] = (_curYearWeek-1)) = BLANK(), BLANK(), MAX(Table3[Price]) = BLANK(), BLANK(), MAX(Table3[Price])-CALCULATE(MAX(Table3[Price]), DateTable[yearweek] = (_curYearWeek-1)))There are a couple of things I had to do before I got it to work. First one is to make sure the DateTable is a Whole Number type:
Second, you need to set the Y-axis of the horizontal bar chart to categorical (otherwise yearweek like 202004 will be displayed as 0.2m:
Have a look at the pbix, again it is Table3, DataTable and page JoostM 🙂 Ignore the rest, those are for other questions 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Hey JarroVGIT,
thank you so much for your quick reply!
The line graph is working for me, but it's not really what I am trying to achieve. I forgot to tell, how I wanted to vizualize the data.
I am trying to get something like this:
So basically a horizontal bar chart. Each bar is for one Project-PartNo, while the value displayed should show the difference between last weeks/months/quarters/... price. That's where I thought a measure is needed.
I created the date table.
Best regards
Joost 🙂
Hi Anonymous ,
I have updated the file here.
The measure for 'delta compared to last week' is this:
LastWeek =
VAR _curYearWeek = SELECTEDVALUE(DateTable[yearweek])
RETURN
SWITCH(TRUE(),
CALCULATE(MAX(Table3[Price]), DateTable[yearweek] = (_curYearWeek-1)) = BLANK(), BLANK(),
MAX(Table3[Price]) = BLANK(), BLANK(),
MAX(Table3[Price])-CALCULATE(MAX(Table3[Price]), DateTable[yearweek] = (_curYearWeek-1)))There are a couple of things I had to do before I got it to work. First one is to make sure the DateTable is a Whole Number type:
Second, you need to set the Y-axis of the horizontal bar chart to categorical (otherwise yearweek like 202004 will be displayed as 0.2m:
Have a look at the pbix, again it is Table3, DataTable and page JoostM 🙂 Ignore the rest, those are for other questions 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂