cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
faizannaeem Regular Visitor
Regular Visitor

Need help getting last value for each month to show as trend graph

Hello everyone,


I am trying to make a trend graph to show the last value for each month to help our team analyze if there performance is getting better or worse.

 

All I can see is Min or Max which is not useful for me in this case.

 

Please see the image for reference. I am showing day-by-day breakdown for month of October where the count ends at 57 which is neither min nor max. Similarly for "Under Tech. Procurement" and other status

 

Capture.JPG

 

So the end result should be a trend like this:

 

Under Review:
End of October: 57

End of November: 45

End of December: 68

(Similarly more lines for other sub-metric as shown in the image above)

 

If the month has not ended, it should give the result with today's date.

 

Please find below the link to the PBIX file

 

https://www.dropbox.com/s/78ytuf57ysc4krz/Need%20Help.pbix?dl=0

 

Is there any way this can be done using a measure or column?

Really appreciate anyone who can help me with this!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Need help getting last value for each month to show as trend graph

Hi @faizannaeem,

 

It looks like the last value per month should be:

1.PNG

 

If that is the case, you can refer to below measure:

lastvalue =
VAR lastdatepermonth =
    ENDOFMONTH ( 'Demands Project (2)'[Attribute] )
RETURN
    CALCULATE (
        MAX ( 'Demands Project (2)'[Value] ),
        FILTER (
            ALLSELECTED ( 'Demands Project (2)' ),
            'Demands Project (2)'[Attribute] = lastdatepermonth
        )
    )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Need help getting last value for each month to show as trend graph

You can use EOMONTH like below to get the last date of the month. You could combine this with a check to see if it is past today's date and adjust accordingly.

 

Column = EOMONTH([Date],0)


Measure = EOMONTH(MAX([Date]),0)

Once you have the End of Month date, then it should be relatively easy to find the value at that date.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

v-yulgu-msft Super Contributor
Super Contributor

Re: Need help getting last value for each month to show as trend graph

Hi @faizannaeem,

 

It looks like the last value per month should be:

1.PNG

 

If that is the case, you can refer to below measure:

lastvalue =
VAR lastdatepermonth =
    ENDOFMONTH ( 'Demands Project (2)'[Attribute] )
RETURN
    CALCULATE (
        MAX ( 'Demands Project (2)'[Value] ),
        FILTER (
            ALLSELECTED ( 'Demands Project (2)' ),
            'Demands Project (2)'[Attribute] = lastdatepermonth
        )
    )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Musto Frequent Visitor
Frequent Visitor

Re: Need help getting last value for each month not NULL to show as trend graph

Hi Everyone,

My probleme is close I Need help getting last value for each month not NULL (if last value is 0 should take the previous if not null to) many thanks 

Best Regards

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 98 members 1,318 guests
Please welcome our newest community members: