Forum Discussion
Measure last dataset
- 7 years ago
Hi marsclone
1. Open Edit Queries,
New source->select Folder->select your folder,
Click on the button on "content"
select any files from the pop-out window,
then get a table with data from all files from this folder.
2.Add two custom column
today=DateTime.Date(DateTime.LocalNow())
day difference=Duration.Days([today]-[date])
3. Filter "day difference"
4. Close&&apply, go to report view
create a calendar table
calendar = CALENDARAUTO()
create relationship
5. Create measures in "weekly data" table
today = TODAY() flag = IF([today]=MAX('calendar'[Date]),1,0) last week data = CALCULATE(SUM('weekly data'[value]),FILTER(ALL('calendar'),'calendar'[Date]=MAX('calendar'[Date])-7))6. Add [date] from "calendar" table in the table visual,
add [flag] in the viusal level filter of the table visual
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi marsclone
1. Open Edit Queries,
New source->select Folder->select your folder,
Click on the button on "content"
select any files from the pop-out window,
then get a table with data from all files from this folder.
2.Add two custom column
today=DateTime.Date(DateTime.LocalNow())
day difference=Duration.Days([today]-[date])
3. Filter "day difference"
4. Close&&apply, go to report view
create a calendar table
calendar = CALENDARAUTO()
create relationship
5. Create measures in "weekly data" table
today = TODAY()
flag = IF([today]=MAX('calendar'[Date]),1,0)
last week data = CALCULATE(SUM('weekly data'[value]),FILTER(ALL('calendar'),'calendar'[Date]=MAX('calendar'[Date])-7))
6. Add [date] from "calendar" table in the table visual,
add [flag] in the viusal level filter of the table visual
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-juanli-msft,
Thank you very much.
This worked!
Regards
Marcel