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
kkalyanrr
Helper V
Helper V

Picking the first and last months of Fiscal Year

Hello,

 

I'm trying to present the data to my team in the following fashion, can you help me with the DAX.


Report Pattern:

YearMonthOpening BalanceClosingBalanceVariance
FY19-20125000145000-20000


DataSet:

YearMonthOpening BalanceClosingBalance
20190712500085000
201908135000115000
201909145000115000
201910115000145000
201911115000135000
20191285000125000
20200112500085000
202002135000115000
202003145000115000
202004115000145000
202005115000135000
20200685000145000




1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @kkalyanrr ,

 

Sorry for my late reply...

Please use the following formula to create a new table:

Table 2 =
ADDCOLUMNS (
    SUMMARIZE (
        'Table',
        "YearMonth",
            "FY" & MIN ( 'Table'[Year] ) & "-"
                & MAX ( 'Table'[Year] ),
        "Opening Balance",
            MINX (
                FILTER ( 'Table', 'Table'[YearMonth] = MIN ( 'Table'[YearMonth] ) ),
                [Opening Balance]
            ),
        "ClosingBalance",
            MAXX (
                FILTER ( 'Table', 'Table'[YearMonth] = MAX ( 'Table'[YearMonth] ) ),
                [ClosingBalance]
            )
    ),
    "w", [Opening Balance] - [ClosingBalance]
)

The final output looks like this:

12.24.2.1.PNG

 

Please take a look at the pbix here.

 

Best Regards,
Eyelyn Qin

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

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @kkalyanrr ,

 

Sorry for my late reply...

Please use the following formula to create a new table:

Table 2 =
ADDCOLUMNS (
    SUMMARIZE (
        'Table',
        "YearMonth",
            "FY" & MIN ( 'Table'[Year] ) & "-"
                & MAX ( 'Table'[Year] ),
        "Opening Balance",
            MINX (
                FILTER ( 'Table', 'Table'[YearMonth] = MIN ( 'Table'[YearMonth] ) ),
                [Opening Balance]
            ),
        "ClosingBalance",
            MAXX (
                FILTER ( 'Table', 'Table'[YearMonth] = MAX ( 'Table'[YearMonth] ) ),
                [ClosingBalance]
            )
    ),
    "w", [Opening Balance] - [ClosingBalance]
)

The final output looks like this:

12.24.2.1.PNG

 

Please take a look at the pbix here.

 

Best Regards,
Eyelyn Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

vanessafvg
Super User
Super User

will this help?  https://www.youtube.com/watch?v=XjAMee2LhKE





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.