powerbidaxdata-analysisdata-transformlog-analysis

How to use or transform product availability logs?


I have product availability logs which contain date, new / old value (as below)

enter image description here.

I would like to use them in the analysis, checking whether the product was available or not on a given day.

I was thinking about transforming the log table into a table containing each day and a value of 0/1 based on the logs. How can I do that easily?

Can it be done with measures in DAX?

I can use Power BI, Power Query, SQL or r / python if it would be more convenient

Thanks for any suggestions


Solution

  • the solution works, thank you @David.

    Nevertheless, I have used R language because it took a long time in PQ (tens of millions of rows to generate).

    Code in R

        df <- df %>%
      rowwise() %>%
      transmute(col1,
                col2,
                date = list(seq(date1, date2, by = "day")),
      ) %>%