Calculate miles driven

0 votes
Trying to calculate miles driven:

Mileage Driven = IF(

    ISFILTERED('Mileage Tracker'[Month]),

    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),

    VAR __PREV_MONTH =

        CALCULATE(

            SUM('Mileage Tracker'[Odometer Reading]),

            DATEADD('Mileage Tracker'[Month].[Date], -1, MONTH)

        )

    RETURN

        Divide(

            SUM('Mileage Tracker'[Odometer Reading]) - __PREV_MONTH,

            __PREV_MONTH

        )

)
May 1, 2021 in Power BI by Eric

edited Mar 4, 2025 342 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP