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
ballist1x
Helper III
Helper III

Need help to create a calculation from a time period and then year on year

Help i am trying to calculate a number from the following that uses a pecific date range ro vcreate a calculation:

 

I am doing this wrong but i am trying to calculate the 'final amount (£) for April 2017-July 2017

 

and then again for April 2018 - July 218

 

Measure = CALCULATE(sum(H12015[Final Amount (£)], FILTER(ALL(H12015[Posting Date].[Month]April), H12015[Posting Date].[2017]).....

 

if you can assist.

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

Hi @ballist1x

First create calculated columns

month =
MONTH ( [Posting Date] )
year =
YEAR ( [Posting Date] )

 

1.png

Then create a measure

Measure =
CALCULATE (
    SUM ( Sheet1[Final Amount (£)] ),
    FILTER (
        ALLSELECTED ( Sheet1[year] ),
        SELECTEDVALUE ( Sheet1[month] ) > 3
            && SELECTEDVALUE ( Sheet1[month] ) < 7
    )
)

2.png

 

 

Best Regards

Maggie

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @ballist1x

First create calculated columns

month =
MONTH ( [Posting Date] )
year =
YEAR ( [Posting Date] )

 

1.png

Then create a measure

Measure =
CALCULATE (
    SUM ( Sheet1[Final Amount (£)] ),
    FILTER (
        ALLSELECTED ( Sheet1[year] ),
        SELECTEDVALUE ( Sheet1[month] ) > 3
            && SELECTEDVALUE ( Sheet1[month] ) < 7
    )
)

2.png

 

 

Best Regards

Maggie

 

@v-juanli-msft

 

i used this, does it give the same resolt?

 

CALCULATE(SUM(H12015[Final Amount (£)]),FILTER(ALL(H12015[Posting Date]),[Posting Date] >= DATE(2017,6,1) && [Posting Date] <= DATE(2017,7,1)))

Hi

This formula will calculate the "final amount (£) from June 1st 2017-July 1st 2017"

 

 

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.