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 Everyone,
I am looking to calculate the marginal product count to understand where we're seeing diminishing returns.
I have two columns of data - Days (which is a calculated DateDiff column I built in the table) and Product Count (which is a measure I created -- counting incidences of the sale of Product X).
I've seen a lot of solutions for calculating a running difference between current row and previous row where the row data is coming from calculated column in the table, but not where the row level data is a measure -- any help would be greatly appreciated!
Product Sales Data --
Day (Calc Column in Table) Product Count (Measure) Marginal Product Count
0 10
1 12 2
2 20 8
And so on...
Thank you!
Solved! Go to Solution.
Hi, @samdep
Please check the below picture and the link down below (sample pbix file) whether it is what you are looking for.
The measure is in the sample pbix file.
Diff qty count =
VAR currentnumber =
MAX ( 'Table'[Day Calc Column] )
VAR onerowbefore =
CALCULATE (
MAX ( 'Table'[Day Calc Column] ),
FILTER ( ALL ( 'Table' ), 'Table'[Day Calc Column] < currentnumber )
)
VAR onerowbeforeqty =
CALCULATE ( [total qty], 'Table'[Day Calc Column] = onerowbefore )
RETURN
IF ( NOT ISBLANK ( onerowbeforeqty ), [total qty] - onerowbeforeqty, BLANK () )
https://www.dropbox.com/s/afahpn09tch8lii/samdep.pbix?dl=0
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.
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 Jihwan,
This worked perfectly! Thank you so much for your help!!
Hi, @samdep
Please check the below picture and the link down below (sample pbix file) whether it is what you are looking for.
The measure is in the sample pbix file.
Diff qty count =
VAR currentnumber =
MAX ( 'Table'[Day Calc Column] )
VAR onerowbefore =
CALCULATE (
MAX ( 'Table'[Day Calc Column] ),
FILTER ( ALL ( 'Table' ), 'Table'[Day Calc Column] < currentnumber )
)
VAR onerowbeforeqty =
CALCULATE ( [total qty], 'Table'[Day Calc Column] = onerowbefore )
RETURN
IF ( NOT ISBLANK ( onerowbeforeqty ), [total qty] - onerowbeforeqty, BLANK () )
https://www.dropbox.com/s/afahpn09tch8lii/samdep.pbix?dl=0
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.
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.
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 |
---|---|
38 | |
26 | |
20 | |
15 | |
8 |
User | Count |
---|---|
69 | |
47 | |
46 | |
20 | |
15 |