Forum Discussion
How to modify data across tables , trying to replicate macro functioality
I am converting an excel report having macro which modifies data/formula in daily worksheet based on values in Events table as below. Any idea how can i achieve this in DAX or ?
I have data in two tables as
Events table:
start dt, end date, span-days
| 3/01/2018 | 4/01/2018 | 1 |
| 4/01/2018 | 9/01/2018 | 5 |
| 9/01/2018 | 9/01/2018 | 0 |
| 9/01/2018 | 9/01/2018 | 0 |
| 9/01/2018 | 9/01/2018 | 0 |
| 9/01/2018 | 9/01/2018 | 0 |
Dailytable: start dt, end dt and idle-hours
| 5/01/2018 | 6/01/2018 | |
| 6/01/2018 | 7/01/2018 | |
| 7/01/2018 | 8/01/2018 | |
| 8/01/2018 | 9/01/2018 |
data in daily table has uniqe dates where in events table it is not.
I want to calculate daily. idel-hours based on events.span-days value such that
if span-days>2 then
loop unitl span-days starting with value of 2 say x
dailytable.startdate+x.idle-hrs= .idle-hrs*60
end
this would create an entry of say 60 in idle-hours for each row in daily table.
How can I achieve this in PowerBI?
Can I create a table using any script or how can access individual row ?
1 Reply
- v-piga-msftResident Rockstar
Hi saqibahmad,
You could have a reference of this similar thread which has been solved.
If you still need help, please share your expected output.
Best Regards,
Cherry