Forum Discussion

matisilver88's avatar
matisilver88
Frequent Visitor
6 years ago

Build a report making date filter

Hi, i`m new in power bi world and datamart. I could make a simple report connection to azure sql, but i need to make a report, where i can filter by dates.

My database model is one table, with the following data:

- MachineId

- Timestamp

- SessionTime

I`d like to make a report showing sessionTime by Machine. I can make the sql query, but i`d like to select from the report a specific day.

The easy query is:  select machineid, sum(sessiontime) from session group by machineid. But i don`t have visibility by day.

Also, i can make an sql group by day:

select machineid, DATEPART(year, timestamp) as yearDATEPART(month, timestamp) as monthDATEPART(day, timestamp) as daysum (sessiontime) as 'use' from session group by machineid,DATEPART(year, timestamp),DATEPART(monthtimestamp),DATEPART(day, timestamp)

But how can i make a report, where user can filter by day and show the session time use?

Thanks

1 Reply

  • matisilver88 in power query, split your timestamp column to date and time and use date for a slicer and time stamp on x-axis and sum on values.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.