Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I am new to PowerBi and this is my first time posting here. What a fantastic forum! Thank you all for your time and sharing your knowledge, you really help people out there a lot!
I would like to generate % change from the actual month to the previous months and have therefore created two index columns with Power Query and then used the EARLIER command.
Then I found two wys of calculating % change but the problem is the same, the results should be down by one line.
Here is the second formula:
In the forum it seems like there are possibilities to copy the table and then merge with PowerQuery, but in this case it is the position of the DAX output that is causing me trouble.
Any suggestions are very much appreciated, thank you!
Solved! Go to Solution.
@SuperSusa
Like this
% Change =
VAR CurrentPrice = 'PQ_Bitumen'[Price]
VAR PreviousPrice =
MAXX (
FILTER ( 'PQ_Bitumen', 'PQ_Bitumen'[Index.1] = EARLIER ( 'PQ_Bitumen'[Index] ) ),
'PQ_Bitumen'[Price]
)
RETURN
DIVIDE ( CurrentPrice - PreviousPrice, PreviousPrice )
hi @SuperSusa
try like:
@SuperSusa
Like this
% Change =
VAR CurrentPrice = 'PQ_Bitumen'[Price]
VAR PreviousPrice =
MAXX (
FILTER ( 'PQ_Bitumen', 'PQ_Bitumen'[Index.1] = EARLIER ( 'PQ_Bitumen'[Index] ) ),
'PQ_Bitumen'[Price]
)
RETURN
DIVIDE ( CurrentPrice - PreviousPrice, PreviousPrice )
@tamerj1 this worked perfectly, thank you so much , you saved my day or should I better say my whole week!:)
Hi @SuperSusa
Just interchange between Index and Index.1 like
FILTER ( 'Table', 'Table'[Index.1] = EARLIER ( 'Table'[Index] ) )
this will retrieve the previous row. Then you can easily calculate the difference then the percentage.
Hi,
Thank you for your reply.
I tried, and it comes close now, but thee values do still not come out right. Since the signs were negative, I converted to positive and vice versa via 0- in front of the equation.
User | Count |
---|---|
57 | |
21 | |
19 | |
17 | |
16 |
User | Count |
---|---|
85 | |
80 | |
52 | |
37 | |
22 |