Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zmukadam
Frequent Visitor

Latest date for each month in a bar graph

Hi,

 

I have to create a bar graph which shows the latest date for each month, I have currently created the chart with selecting the latest date but I would like this to happen automatically, is there a way of creating this?Bar chart.png

Any help would be great.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

In the picture, you will see the source data and the actual result.  You may download my PBI file from here.

Hope this helps.

Untitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

In the picture, you will see the source data and the actual result.  You may download my PBI file from here.

Hope this helps.

Untitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-shex-msft
Community Support
Community Support

HI @zmukadam ,

In my opinion, I'd like to suggest you to add a measure to compare current date and corresponded last date and return flag. After these, you can use this measure as filter on visual level.

Measure =
VAR currDate =
    MAX ( 'Table'[Date] )
VAR _lastdate =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[Date] ) = YEAR ( currDate )
                && MONTH ( 'Table'[Date] ) = MONTH ( currDate )
        )
    )
RETURN
    IF ( currDate = _lastdate, "Y", "N" )

70.gif

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.