Forum Discussion
pk1593
Helper I
3 years agoHelp creating a DAX measure!
How to create a 'measure' in Power BI to get previous value using this dataset ? I have shown the previous value table as an eg. of the desired output. I want the previous data to be referred for...
- 3 years ago
Hi,
You may download my PBI file from here. The second table shows your desired result.
Hope this helps.
pk1593
Helper I
3 years agoPlease use this .pbix file.
https://drive.google.com/drive/folders/1EV-sQ1ZXhYnZoacPTiL6J4SJsLqW1jun?usp=share_link
Ashish_Mathur
Super User
3 years agoHi,
You may download my PBI file from here. The second table shows your desired result.
Hope this helps.
- pk15933 years ago
Helper I
Thank you Ashish for the help. The previous value is coming correctly but the sum of weights and % of wt calculation there seems an issue.
As for the sum of weights, the sum of weights need to be distinct by ID - refer Measure !Wtd_Sum (it cannot be sum of total weights as done in 'Wt') and the Measure !Percent is trying to calculate :
!Percent =SUM([Weights])/TOTAL(SUM([Weights])) {Tableau code} Total is used so that the denominator doesnt take filter into consideration and it calulates the %.The code I have kept for !Percent seems to divide the sum by the total weights in all the timeperiod and is not filtered by respective quarter. The desired result is mentioned in the attached excel file : Link- Ashish_Mathur3 years ago
Super User
I cannot understand what you want. Someone who does will help you.