Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have table structure like this:
Identifier | Row Index | Quantity (Measure) | Price (Measure) | Previous Price |
ABC123 | 50 | 100 | 190 | <blank> |
ABC123 | 55 | 120 | 202 | 190 |
ABC123 | 85 | 140 | 196 | 202 |
ABC123 | 112 | 80 | 210 | 196 |
ABC123 | 525 | 95 | 204 | 210 |
Is it possible to get Previus Price as a new measure from the measure? Note that every row has index so basicaly just finding the Price for the previous Row Index where Identifier is the same. I just couldnt make it work in vars.
Thank you!
Solved! Go to Solution.
I quite do not understand what you want.
I assume you want to change your sample like the below to consider various types of identifiers.
Please check the below picture.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi, @MrMP
Please try the below.
Previous Price =
VAR currentrowindex =
MAX ( 'Table'[Row Index] )
VAR previousrowindex =
CALCULATE (
MAX ( 'Table'[Row Index] ),
FILTER ( ALL ( 'Table' ), 'Table'[Row Index] < currentrowindex )
)
RETURN
CALCULATE ( [Price total], 'Table'[Row Index] = previousrowindex )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
previusrowindex also has to be constrained to identifier. how to add that?
Hi, @MrMP
Thank you for your feedback, and sorry that I quite do not understand your question.
I assume you want to see the previous index number in a table as well.
Previous row index =
VAR currentrowindex =
MAX ( 'Table'[Row Index] )
VAR previousrowindex =
CALCULATE (
MAX ( 'Table'[Row Index] ),
FILTER ( ALL ( 'Table' ), 'Table'[Row Index] < currentrowindex )
)
RETURN
previousrowindex
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
For Previusrowindex I have to add also filter for Identifier since there are many identifiers in the table.
I quite do not understand what you want.
I assume you want to change your sample like the below to consider various types of identifiers.
Please check the below picture.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
You can try the following measures
Previous =
VAR currentindex =
MAX ( 'Table'[Row Index] )
VAR Result =
CALCULATE (
[Price Measure],
'Table'[Row Index] < currentindex
)
RETURN
Result
Regards,
Sayali
If this post helps, then please consider Accept it as the solution to help others find it more quickly
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |