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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Thunders
Frequent Visitor

BI Measure

It's so easy on exel...but now on BI

I'm trying to create aggregated measure - see below in excel. Any help appreaciated! 

Thank you

Thunders_0-1704376118786.png

 

1 ACCEPTED SOLUTION
MrBrownn
Frequent Visitor

Good morning Thunders,
We need more details for the Quota, is it always 2500 ? or it's change by month ?

Why you choose r
You can for exemple use something like that : 
__Mesure =
Var Total = CALCULATE(SUM(Quota), ALL(Dates) // it will calculate all total of the quota
Var Aggre = CALCULATE(SUM(Sales), Dates[Month] >= EOMONTH(MAX('Dates'[Month]), -3) //Calculate the sum of every 3 last months

RETURN DIVIDE(Aggre, Total)

 

 

View solution in original post

6 REPLIES 6
rautaniket0077
Resolver I
Resolver I

Hi @Thunders, I think @v-yiruan-msft gave the perfect solution. The alternate way is to set your date as financial date with April being the 1st month.  Here is how to do that.

create a date table--

rautaniket0077_0-1704799839055.png

 

  create month no

rautaniket0077_1-1704799876744.png


create month 

rautaniket0077_2-1704799894674.png

and then sort your month by month no

Establish the relationship between this newly form date table and your table then, you can have this below measure 

var _sales =
CALCULATE(
    SUM('Table'[sales]),
    FILTER(
        ALLSELECTED('date'),
        'date'[month no] <= MAX('date'[month no])
    )
)

var _quota =
CALCULATE(
    SUM('Table'[quota]),
    ALLSELECTED('Table')
)

return DIVIDE(_sales,_quota)

rautaniket0077_3-1704800056333.png

which will give you the output

rautaniket0077_4-1704800124982.png

 

Thank you.


v-yiruan-msft
Community Support
Community Support

Hi @Thunders ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Add one index column in Power Query Editor

vyiruanmsft_0-1704794979106.png

2. Create a measure as below to get the percentage

Aggregated Att% =
VAR _culpart =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Index] <= SELECTEDVALUE ( 'Table'[Index] )
        )
    )
VAR _allquota =
    CALCULATE ( SUM ( 'Table'[Quota] ), ALLSELECTED ( 'Table' ) )
RETURN
    DIVIDE ( _culpart, _allquota )

vyiruanmsft_1-1704795350207.png

Best Regards

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

Good morning Thunders,
We need more details for the Quota, is it always 2500 ? or it's change by month ?

Why you choose r
You can for exemple use something like that : 
__Mesure =
Var Total = CALCULATE(SUM(Quota), ALL(Dates) // it will calculate all total of the quota
Var Aggre = CALCULATE(SUM(Sales), Dates[Month] >= EOMONTH(MAX('Dates'[Month]), -3) //Calculate the sum of every 3 last months

RETURN DIVIDE(Aggre, Total)

 

 

Hi MrBrownn,

The 2500 is the monthly qouta, does not change.

Hi, I think I can help with this, but I need to ask a few questions to clarify, because the solution will be different depending how you answer.

 

1. Do you use a date table?

2. If you do, is it financial year based, starting on April?

3. Do you have data only for these 12 months?

4. Will there be more data coming in, for different years?

 

Also, @MrBrownn, correct me if I'm mistaken, but the question is asking for a running total divided by the total budget. So it won't be the last 3 months every time, but all the previous ones.

1. Do you use a date table? Yes

2. If you do, is it financial year based, starting on April? Yes

3. Do you have data only for these 12 months? Yes

4. Will there be more data coming in, for different years? It will be a 100% new project.

Thank you

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors