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.
I have a union table that was created from two summary tables from separate queries.
The columns that I currently have is Site, Dept, Date. I need to create an additonal column that calculates the previous date in the date column where the site and dept match so we can analyze the shrink per day for the department. Below is a sample of what the table will look like once I can figure out how to calculate the previous date column. Thanks for any assistance on this!!
Site | Dept | Date | O/s | Last Date | Date Diff |
163 | Packaged Beverage | 10/21/2019 | 6 | 9/8/2019 | 43 |
165 | OTP | 10/20/2019 | 7 | 6/8/2019 | 134 |
166 | Snacks | 10/20/2019 | 3 | 5/4/2019 | 169 |
163 | Packaged Beverage | 9/8/2019 | 4 | 4/1/2019 | 160 |
165 | OTP | 6/8/2019 | 1 | 3/1/2019 | 99 |
166 | Snacks | 5/4/2019 | 2 | 2/1/2019 | 92 |
Solved! Go to Solution.
Try this:
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Last date calc = var _cDate ='Table'[Date] var _calc = CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Site],'Table'[Dept]),'Table'[Date]<_cDate)) return _calc
Proud to be a Super User!
Try this:
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Last date calc = var _cDate ='Table'[Date] var _calc = CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Site],'Table'[Dept]),'Table'[Date]<_cDate)) return _calc
Proud to be a Super User!
You are welcome!
Nathaniel
Proud to be a Super User!
PBIX MY FILE
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |