Forum Discussion

AbhiroopGhosh's avatar
AbhiroopGhosh
New Member
1 year ago
Solved

User Input in Power BI

Hello Everyone,

 

I’m working on creating a Power BI report where users can input a specific date to drive the metrics displayed in the report. I’m exploring options to achieve this and need some guidance.

 

Here’s the dataset I’m working with:

 

I’d like users to be able to enter a report date and see metrics based on that date. For example:

  • If the user enters “09/03/2024,” the metrics should be:
    • Number of Issues Logged: 04
    • Number of Issues Completed: 02
    • Number of Open Issues: 02
    • Number of Issues Logged in the Last Two Days (09/03 – 09/02): 03
  • If the user enters “09/07/2024,” the metrics should be:
    • Number of Issues Logged: 09
    • Number of Issues Completed: 03
    • Number of Open Issues: 06
    • Number of Issues Logged in the Last Two Days (09/07 – 09/06): 01

I attempted to use a date slicer for this purpose, but it seems to default to the minimum date, regardless of the date selected. I’m looking for a way to allow user input for the report date without using Power Apps.

Any suggestions on how I might achieve this functionality in Power BI?

Thank you for your help!

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi AbhiroopGhosh 

    Based on your needs, I have created the following table.

     

    Then you can use the following measure to calculate the result you want:

     

    Number of Issues Logged = COUNTROWS('Table')

     

    Number of Issues Completed = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Status] = "Completed"))

     

    Number of Open Issues = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Status] = "In-Progress"||'Table'[Status] = "Not started"))

     

    Number of Issues Logged in the Last Two Days = CALCULATE(COUNTROWS('Table'),DATESINPERIOD('Table'[Logged date],SELECTEDVALUE('Table'[Logged date]),-2,DAY))

     

     

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Hi,

    I do not understand your question.  First of all, in the Query Editor, ensure that the data type of the Logged Date column is Date.  Create a Calendar Table.  Create a relationship (Many to One and Single) from the Logged date column of the Data Table to the Date column of the Calendar Table.  To any visual, drag Date column from the Calendar Table.  Now write measures.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AbhiroopGhosh 

    Based on your needs, I have created the following table.

     

    Then you can use the following measure to calculate the result you want:

     

    Number of Issues Logged = COUNTROWS('Table')

     

    Number of Issues Completed = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Status] = "Completed"))

     

    Number of Open Issues = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Status] = "In-Progress"||'Table'[Status] = "Not started"))

     

    Number of Issues Logged in the Last Two Days = CALCULATE(COUNTROWS('Table'),DATESINPERIOD('Table'[Logged date],SELECTEDVALUE('Table'[Logged date]),-2,DAY))

     

     

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.