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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SEPA
Frequent Visitor

Calculate average by distinct dividend value for each category in POWER BI / DAX

Hi All,

I have a data like below and i want to calculate the average by distinct divident category.

Data:

MonthCountryStoreTHRSValue%pctn
APRSingaporeSG12005025.00
APRSingaporeSG12006030.00
APRSingaporeSG21002020.00

 


now i want to calculate the average by Store:

Expected result:

 Avg
SG127.50
SG220.00

 

The dax i tried:

 

measure1_mecaverage_by_str_monthly_trend =
CALCULATE (
AVERAGE ('Fact'[pctn]),
ALLEXCEPT ( 'Fact', 'Fact'[Month], Fact[Country],Fact[Store])
)
 
Can help to calculate average by using distinct divident value for each store

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @SEPA ,

 

Using your measures will give you the results you expect.

vcgaomsft_0-1651111714042.png

vcgaomsft_1-1651111849124.png

Or am I not understanding your needs? If you want to use different measure for different stores, you can try using the SWITCH functions. For example.

Measure = 
SWITCH(
    TRUE(),
    MAX('Fact'[Store]) = "SG1",[measure1_mecaverage_by_str_monthly_trend],
    MAX('Fact'[Store]) = "SG2",[measure2_mecaverage_by_str_monthly_trend])

Then drag the measure and field [Store] into the table visual.

 

The pbix file is attached for reference.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

Anonymous
Not applicable

Dear @SEPA,

 

Please try using this measure.

Average of country = 
CALCULATE (
    AVERAGEX (
        VALUES ( 'Fact'[Store] ),
        [measure1_mecaverage_by_str_monthly_trend]
    ),
    ALL ( 'Fact' )
)

vcgaomsft_0-1651129556654.png

The pbix file is attached for reference.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @SEPA ,

 

Using your measures will give you the results you expect.

vcgaomsft_0-1651111714042.png

vcgaomsft_1-1651111849124.png

Or am I not understanding your needs? If you want to use different measure for different stores, you can try using the SWITCH functions. For example.

Measure = 
SWITCH(
    TRUE(),
    MAX('Fact'[Store]) = "SG1",[measure1_mecaverage_by_str_monthly_trend],
    MAX('Fact'[Store]) = "SG2",[measure2_mecaverage_by_str_monthly_trend])

Then drag the measure and field [Store] into the table visual.

 

The pbix file is attached for reference.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Dear V-Cgao-msft,

Thanks for your response on this. And, yes the distinct average for store is comign fine, but however i am facing issue while calculating average for the calculated measure.

 

below is expected, 

monthcountrystorethrsvaluesAvergae of each recordAverage of StoreAverage of country
APRSingaporeSG12005025.0%27.50%23.75%
APRSingaporeSG12006030.0%
APRSingaporeSG21002020.0%20.00%
       this one is average of G

 

need to find out average of country from already calculated measure (average of store)

SEPA
Frequent Visitor

yes i was looking the above output

Anonymous
Not applicable

Dear @SEPA,

 

Please try using this measure.

Average of country = 
CALCULATE (
    AVERAGEX (
        VALUES ( 'Fact'[Store] ),
        [measure1_mecaverage_by_str_monthly_trend]
    ),
    ALL ( 'Fact' )
)

vcgaomsft_0-1651129556654.png

The pbix file is attached for reference.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Thank you, it works for me...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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