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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Diptarup
Helper II
Helper II

Values derived based on multipe criteria

Hi All,

 

I am new to PowerBi and working on solution wherein I have to determine the value of Country based on Product Category. Let's take an example so that it can be clear:-

YearCountryProduct CategoryProduct NameSub - CategoryValue
2021IndiaAIronC10
2021IndiaAIronC21
2021IndiaAIronC31
2021IndiaAIronC40
2021IndiaAIronC51
2021IndiaAIronC60
2021IndiaAIronC70
2021IndiaAIronC80
2021IndiaAIronC90
2021IndiaAIronC100
2021IndiaAIronC111
2021IndiaAIronC121
2021IndiaAAluminiumC10
2021IndiaAAluminiumC21
2021IndiaAAluminiumC31
2021IndiaAAluminiumC40
2021IndiaAAluminiumC50
2021IndiaAAluminiumC60
2021IndiaAAluminiumC70
2021IndiaAAluminiumC80
2021IndiaAAluminiumC91
2021IndiaAAluminiumC101
2021IndiaAAluminiumC111
2021IndiaAAluminiumC120
2021IndiaASteelC11
2021IndiaASteelC20
2021IndiaASteelC31
2021IndiaASteelC40
2021IndiaASteelC51
2021IndiaASteelC60
2021IndiaASteelC70
2021IndiaASteelC81
2021IndiaASteelC91
2021IndiaASteelC100
2021IndiaASteelC111
2021IndiaASteelC121
2021IndiaACopperC10
2021IndiaACopperC20
2021IndiaACopperC30
2021IndiaACopperC40
2021IndiaACopperC50
2021IndiaACopperC60
2021IndiaACopperC71
2021IndiaACopperC80
2021IndiaACopperC90
2021IndiaACopperC100
2021IndiaACopperC110
2021IndiaACopperC121
2021IndiaBWoodC11
2021IndiaBWoodC20
2021IndiaBWoodC31
2021IndiaBWoodC41
2021IndiaBWoodC51
2021IndiaBWoodC60
2021IndiaBWoodC70
2021IndiaBWoodC81
2021IndiaBWoodC90
2021IndiaBWoodC100
2021IndiaBWoodC110
2021IndiaBWoodC120
2021IndiaBCottonC10
2021IndiaBCottonC21
2021IndiaBCottonC31
2021IndiaBCottonC41
2021IndiaBCottonC50
2021IndiaBCottonC60
2021IndiaBCottonC70
2021IndiaBCottonC81
2021IndiaBCottonC90
2021IndiaBCottonC100
2021IndiaBCottonC110
2021IndiaBCottonC120
2021IndiaBGlassC10
2021IndiaBGlassC21
2021IndiaBGlassC31
2021IndiaBGlassC41
2021IndiaBGlassC50
2021IndiaBGlassC60
2021IndiaBGlassC70
2021IndiaBGlassC81
2021IndiaBGlassC90
2021IndiaBGlassC100
2021IndiaBGlassC110
2021IndiaBGlassC120
2021IndiaBPlasticC11
2021IndiaBPlasticC20
2021IndiaBPlasticC30
2021IndiaBPlasticC41
2021IndiaBPlasticC50
2021IndiaBPlasticC61
2021IndiaBPlasticC70
2021IndiaBPlasticC81
2021IndiaBPlasticC90
2021IndiaBPlasticC100
2021IndiaBPlasticC110
2021IndiaBPlasticC120
2021IndiaCBikeC11
2021IndiaCBikeC21
2021IndiaCBikeC31
2021IndiaCBikeC40
2021IndiaCBikeC50
2021IndiaCBikeC60
2021IndiaCBikeC70
2021IndiaCBikeC80
2021IndiaCBikeC90
2021IndiaCBikeC100
2021IndiaCBikeC111
2021IndiaCBikeC121
2021IndiaCCarC11
2021IndiaCCarC21
2021IndiaCCarC31
2021IndiaCCarC40
2021IndiaCCarC50
2021IndiaCCarC60
2021IndiaCCarC70
2021IndiaCCarC80
2021IndiaCCarC90
2021IndiaCCarC100
2021IndiaCCarC111
2021IndiaCCarC121
2021IndiaCCycleC11
2021IndiaCCycleC21
2021IndiaCCycleC31
2021IndiaCCycleC40
2021IndiaCCycleC51
2021IndiaCCycleC61
2021IndiaCCycleC71
2021IndiaCCycleC81
2021IndiaCCycleC91
2021IndiaCCycleC101
2021IndiaCCycleC110
2021IndiaCCycleC121
2021IndiaCCartC11
2021IndiaCCartC21
2021IndiaCCartC31
2021IndiaCCartC40
2021IndiaCCartC51
2021IndiaCCartC61
2021IndiaCCartC71
2021IndiaCCartC81
2021IndiaCCartC91
2021IndiaCCartC101
2021IndiaCCartC110
2021IndiaCCartC121
2021IndiaD E14
2021IndiaD E23
2021IndiaD E32

 

From the above table we need to find out the value of the Countries by per Product Category. To get that we need to Add all the values given under sub category on the basis of groupings per Prodcut Category  ---

 

Group 1= C1+C2+C3+C4

Group 2 = C5+C6+C7+C8

Group 3= C9+C10+C11+C12

 

Then we need to do average of Group 1+ Group 2+ Group 3 

 

Taking this formula the Output for India would be like :-

India : Product Category A = Group 1 + Group 2 + Group 3

                     1.83               =     2.00      + 1.75      + 1.75

           Product Category B = Group 1 + Group 2 + Group 3

                      1.42              =   2.75       + 1.50   +    0.00 

           Product Category C = Group 1 + Group 2 + Group 3

                       2.50             =   3.00       +2.00       +    2.50

           Product Category D =        E1     + E2    + E3

                      0.67               =       1.00 +   1.00 +    0.00

 

 

Any help will be highly appreciated.

5 REPLIES 5
linh091
Resolver I
Resolver I

I made a PBI file with easy way for you. You can see step by step in the Transform:

https://drive.google.com/file/d/1KWhhYtmb1D1-zLThwT1yCLUW192p5wcY/view?usp=sharing
- Creating a group table

- Join your data with that group

- Group row with sum value

- Pivot column

- Create a average column by DAX

Unfortunately, I am not able to view the file through the link. Can you please share the pbix or screenshot of the same

 

I share a folder again, you can downlaod the Powerbi file:
https://drive.google.com/drive/folders/1qZh8MtEuSvm9F-kERIX3AZ12wxWxpFoU?usp=sharing

amitchandak
Super User
Super User

@Diptarup ,

Create a new column

Switch ( True(),
[Sub - Category] in{ "C1","C2","C3","C4"} , "Group 1",
[Sub - Category] in{ "C5","C6","C7","C8"} , "Group 2",
[Sub - Category] in{ "C9","C10","C11","C12"} , "Group 3"
)

 

Create a new measure

Avg Value = averagex(Values(Table[Group]), calculate(sum(Table[Value])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Not working, it is giving the sum value. Results I am getting are 6.33,   5.67,    10.00

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors