AbhiroopGhosh
AbhiroopGhosh

Reputation: 65

Generating Power BI Metrics based on user input

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:

enter image description here

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:

If the user enters “09/07/2024,” the metrics should be:

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!

Upvotes: 0

Views: 43

Answers (1)

Ryan
Ryan

Reputation: 2362

You can create a date table and use the date in that table to filter

date=CALENDAR(min('Table'[Logged Date]),max('Table'[Logged Date]))

enter image description here

do not create relationships between these two tables

then create measures

Number of Issues Logged =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER ( 'Table', 'Table'[Logged Date] <= SELECTEDVALUE ( 'date'[Date] ) )
)

Number of Issues Completed =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        'Table',
        'Table'[Logged Date] <= SELECTEDVALUE ( 'date'[Date] )
            && 'Table'[Status] = "Completed"
    )
)

Number of Open Issues = [Number of Issues Logged]-[Number of Issues Completed]

Number of Issues Logged in the Last Two Days =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        'Table',
        'Table'[Logged Date] <= SELECTEDVALUE ( 'date'[Date] )
            && 'Table'[Logged Date]
                >= SELECTEDVALUE ( 'date'[Date] ) - 1
    )
)

enter image description here

Upvotes: 0

Related Questions