The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I've met huge block creating report for Supply Rotation.
Data that I'm using is extract from our warehouse system, with codes for each product, amounts etc. I'm creating Rotation report so I need to show how each item rotated TILL last 30/60days.
What I need to create:
- User should be able to pick date he wants (for example till 04.02.2022)
After picking that date 3 tables should be filtered according to that slicer :
first should show exact date from slicer (sum of values for each product till 04.02.2022)
second one should show 30 days before that date (sum of values for each product till 05.01.2022)
third one should show 60 days before that date (sum of values for each product till 06.12.2021).
And here is where steps are starting, I have no idea how to do corelations like that.
2nd problem is how to sum values from weird date range - 30 days after exact date.
For example - I ned to see sum of values from certain date till 30 days later (User picks 05.01.2022 and I need to sum next 30 days).
I've tried some calculations and Sumx but couldn't handle it.
Thx for all help!
@Anonymous , create an independent date table for that. Do not join with any table
//Date1 is independent Date table, Date is joined with Table
new measure equal max=
var _max = maxx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] =_max))
//Date1 is independent Date table, Date is joined with Table
new measure last 30 =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -30
return
calculate( sum(Table2[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
//Date1 is independent Date table, Date is joined with Table
new measure last 60=
var _max = maxx(allselected(Date1),Date1[Date])
var _min = _max -60
return
calculate( sum(Table3[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
In filter in place of date table, you can use the respective table and date
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
10 | |
7 |