Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello community,
I have two tables that are connected through product ID. Table 1 consists of product details including date of product launch. Table 2 consists of sale details including date of sale and number of sales on each date.
Table 2 is continuously updated on a daily basis while Table 1 is maintained manually with ad-hoc updations.
The result I would like to prepare is a graph which has the number of days since launch on the x-axis and the running total of sales on the Y axis. reference image below:
Joining the tables and getting the running total was something i was able to perform. however, how do i create a separate field for # of days since launch? as a calculated measure it is not possible to have it on the x-axis. Even in the pivot table, I cannot drag it as a category field. So how does one solve for this?
Google Drive link to sample data
Solved! Go to Solution.
@Anonymous
You may refer to the following post.
https://community.powerbi.com/t5/Desktop/Aggregates-of-counts-over-time/td-p/281500
@Anonymous
You may refer to the following post.
https://community.powerbi.com/t5/Desktop/Aggregates-of-counts-over-time/td-p/281500
So create a column in Table2 "Days since Launch". Use LOOKUPVALUE to lookup the launch date, then the column is:
Days since Launch Column =
VAR __LaunchDate = LOOKUPVALUE('Table1,...)
RETURN
([Date] - __LaunchDate) * 1.
Thanks for the input Greg. I tried that idea but it would work if there was only product. In this case there are multiple products to compare. How does one compare # of days since launch for multiple products?
User | Count |
---|---|
103 | |
87 | |
77 | |
70 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |