cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rschaudhr
Frequent Visitor

Create a measure based on date filter slicer

I have a dashboard with Table visualization and has a date filter. I want to create a calcutate measure based on the end date of the date slicer. 

 

So, if my date range in date slicer is from 7/25/2019 to 8/19/2019, then the measure should only take value from 8/19/2019. Further more, I have a measure already and would like to incorporate it in the measure if possible. The measure is as follows:

 

Calculate = divide(sum([EOP MV]), CALCULATE(SUM([EOP MV]),ALLEXCEPT(IPA,Date,[Manager])))
 
I hope this is enough information. 
 
Thank you,
RC

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Create a measure based on date filter slicer

Hello @rschaudhr 

Give this a try.

Measure =
VAR _LastDate =
    LASTDATE ( Dates[Date] )
RETURN
    CALCULATE (
        DIVIDE (
            SUM ( [EOP MV] ),
            CALCULATE ( SUM ( [EOP MV] ), ALLEXCEPT ( IPA, Date, [Manager] ) )
        ),
        _LastDate
    )

View solution in original post

rschaudhr
Frequent Visitor

Re: Create a measure based on date filter slicer

Actually, I am misspoken. Your solution did work. Thank you for this. 

View solution in original post

5 REPLIES 5
Super User II
Super User II

Re: Create a measure based on date filter slicer

Here is a post about creating the measure that references a date range slicer

https://community.powerbi.com/t5/Desktop/Filter-data-using-date-range-from-slicer/td-p/483072





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Highlighted
Super User IV
Super User IV

Re: Create a measure based on date filter slicer

Hello @rschaudhr 

Give this a try.

Measure =
VAR _LastDate =
    LASTDATE ( Dates[Date] )
RETURN
    CALCULATE (
        DIVIDE (
            SUM ( [EOP MV] ),
            CALCULATE ( SUM ( [EOP MV] ), ALLEXCEPT ( IPA, Date, [Manager] ) )
        ),
        _LastDate
    )

View solution in original post

rschaudhr
Frequent Visitor

Re: Create a measure based on date filter slicer

Unfortunately, this did not work

Super User IV
Super User IV

Re: Create a measure based on date filter slicer

@rschaudhr 

You will have to give a bit more information.  Did you receive an error or an unexpected result?  Can you share some of your sample data in a format that can be copied (not a screen shot) and show us how your model is layed out and what the expected result is?

rschaudhr
Frequent Visitor

Re: Create a measure based on date filter slicer

Actually, I am misspoken. Your solution did work. Thank you for this. 

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors