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!
I work at a company that lends products for sales representaives that eventually return the products.
So I am building a report which should display the current product quantity that each representative has in its hands.
Here is a simplifield example of my fact table:
product_loan:
quantity | loan_date | return_date |
5 | 01/jan/2023 | 15/jan/2023 |
10 | 05/jan/2023 | 20/jan/2023 |
3 | 20/jan/2023 |
I would like to be able to plot a chart like this, which display the current quantity not returned in each date (I have a Date Dimension Table):
What I want to achieve seems to be similar to a cash book logic, with debt, credit and balance for each day.
I am struggling with this because I have a Date dimension table, but I am not able to create a relationship with both loan_date and return_date at the same time. Also, I am not sure if this "current quantity not returned" should be a calculated measure or if I should create calculated table instead to support this calculation.
I would appreciate any help.
Solved! Go to Solution.
Hi @neil_floyd ,
Please refer to my pbix file to see if it helps you.
Add a custom column.
List.Transform(try {Number.From([loan date])..Number.From([return date])} otherwise {Number.From([loan date])..Number.From(Date.EndOfMonth([loan date]))} ,each Date.From(_))
Then create a measure.
Measure = CALCULATE(SUM('Table'[quantity]),FILTER(ALL('Table'),'Table'[Custom]=SELECTEDVALUE('Table'[Custom])))
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @neil_floyd ,
Please refer to my pbix file to see if it helps you.
Add a custom column.
List.Transform(try {Number.From([loan date])..Number.From([return date])} otherwise {Number.From([loan date])..Number.From(Date.EndOfMonth([loan date]))} ,each Date.From(_))
Then create a measure.
Measure = CALCULATE(SUM('Table'[quantity]),FILTER(ALL('Table'),'Table'[Custom]=SELECTEDVALUE('Table'[Custom])))
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@neil_floyd , refer
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
Use a date table
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
32 | |
30 | |
18 | |
18 |