Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I am trying to fo tthe following and struggling - I am sure this is easy but just can't see it.
| New Hires | Retirees | Total Workforce |
| 3 | 5 | 20 |
| 6 | 3 | 23 |
| 8 | 1 | 30 |
| 9 | 8 | 31 |
| 4 | 6 | 29 |
| 3 | 1 | 31 |
| 2 | 1 | 32 |
| 7 | 8 | 31 |
So in excel my first row = 22 +New Hires - Retirees
My second row = 20 (the result from the previous row) +NewHires - Retirees
My third row = 23 (the result from the previous row) +NewHires - Retirees
etc..
Tried various things including EARLIER, using indexing,
Solved! Go to Solution.
Hello @Casperserven1 ,
We can achieve this using multiple ways but I can recall and create using one way among them.
You may need to create four columns for this.
First two columns are index columns from '0' and '1' which can be created in Power Query Editor.
For next two columns the DAX calculations looks as below:
Reference = IF('Data Table'[Index] = 0, 'Data Table'[Total Workforce],LOOKUPVALUE('Data Table'[Total Workforce],'Data Table'[Index New],'Data Table'[Index]))Result = IF('Data Table'[Index]=0,'Data Table'[Reference],'Data Table'[Reference]+'Data Table'[New Hires]-'Data Table'[Retirees])
Output looks like this:
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
Many thanks - yes that works, however I wanted this to be a measure so that I can apply row context to it - any ideas using measures??
Many thanks - yes that works, however I wanted this to be a measure so that I can apply row context to it - any ideas using measures??
Hello @Casperserven1 ,
We can achieve this using multiple ways but I can recall and create using one way among them.
You may need to create four columns for this.
First two columns are index columns from '0' and '1' which can be created in Power Query Editor.
For next two columns the DAX calculations looks as below:
Reference = IF('Data Table'[Index] = 0, 'Data Table'[Total Workforce],LOOKUPVALUE('Data Table'[Total Workforce],'Data Table'[Index New],'Data Table'[Index]))Result = IF('Data Table'[Index]=0,'Data Table'[Reference],'Data Table'[Reference]+'Data Table'[New Hires]-'Data Table'[Retirees])
Output looks like this:
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 40 | |
| 36 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 38 | |
| 34 | |
| 23 |