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
Anonymous
Not applicable

Measure to visualise total asset balance of the most recent full month vs end of last previous years

Hi,

 

I'm really new to Power Bi and not very good at DAX yet so I was hoping someone might be able to help me.

 

I'm trying to create a visualisation of total asset balance in the most recent full month (e.g. August 2018) dynamically (so if today is October, I will have a bar for September 2018 rather than August 2018) vs end of last previous years (i.e. as at December of each year). So something like the chart attached.  

 

I was able to use the quick measure Filtered value function to only filter the sum of all assets for the month of December. So I have the previous years sorted. However, I need to sort of insert another bar for the most recent full month for this year.

 

Any ideas how I can make this work?

 

Thanks

CUR

Asset balance comparison chart.png

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

You can try to use below measure:

Measure =
VAR currDate =
    MAX ( 'Assets by Year and Type'[Date] )
RETURN
    IF (
        MONTH ( currDate ) = 12
            || FORMAT ( currDate, "mm/yyyy" )
                = FORMAT ( DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 2, 1 ), "mm/yyyy" ),
        CALCULATE (
            SUM ( 'Assets by Year and Type'[Assets running total in ValDate] ),
            FILTER (
                ALLSELECTED ( 'Assets by Year and Type' ),
                FORMAT ( [Date], "mm/yyyy" ) = FORMAT ( currDate, "mm/yyyy" )
            ),
            VALUES ( 'Assets by Year and Type'[Type] )
        )
            + 0
    )

 10.PNG

 

Regards,

Xiaoxin Sheng

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

View solution in original post

16 REPLIES 16

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.