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 am trying to calculate the delta of product quantity for two dynamically selected dates. I have a table populating the beginning, ending and the delta inventory for both the dates. Now I am having trouble calculating the delta between DI2-DI1 as shown in the image. The date selection is dynamic and User selected. The sample data and the .pbix files are uploaded to Goggle Drive. Any help is appreciated.
Solved! Go to Solution.
Hi @sridharpolina ,
Here are the steps you can follow:
1. Create calculated table.
Table = SUMMARIZE('Inventory Changes','Inventory Changes'[as_of_date])
Result:
2. Replace the second slicer with [as_of_date] of the newly created table
3. Select the slicer above, select Edit interactions of Format, and select the Filter flags in both tables
4. Create measure.
_begin =
SUMX(FILTER(ALL('Inventory Changes'),[as_of_date] in SELECTCOLUMNS('Table',"1",[as_of_date])&&[product_identifier1]=MAX([product_identifier1])),[opening_inv])
_end =
SUMX(FILTER(ALL('Inventory Changes'),[as_of_date] in SELECTCOLUMNS('Table',"1",[as_of_date])&&[product_identifier1]=MAX([product_identifier1])),[closing_inv])
Delta_Inventory1 =
[_end]-[_begin]
Delta_Inventory2 =
SUM('Inventory Changes'[Delta_Inventory])-[Delta_Inventory1]
5. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sridharpolina ,
Here are the steps you can follow:
1. Create calculated table.
Table = SUMMARIZE('Inventory Changes','Inventory Changes'[as_of_date])
Result:
2. Replace the second slicer with [as_of_date] of the newly created table
3. Select the slicer above, select Edit interactions of Format, and select the Filter flags in both tables
4. Create measure.
_begin =
SUMX(FILTER(ALL('Inventory Changes'),[as_of_date] in SELECTCOLUMNS('Table',"1",[as_of_date])&&[product_identifier1]=MAX([product_identifier1])),[opening_inv])
_end =
SUMX(FILTER(ALL('Inventory Changes'),[as_of_date] in SELECTCOLUMNS('Table',"1",[as_of_date])&&[product_identifier1]=MAX([product_identifier1])),[closing_inv])
Delta_Inventory1 =
[_end]-[_begin]
Delta_Inventory2 =
SUM('Inventory Changes'[Delta_Inventory])-[Delta_Inventory1]
5. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |