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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to Create a New Row for a Category & Calculate an avg of other categories when there is no data?

Hi Everyone, 

 

The Sample data looks like the below,

Country / CategoryABC
South Africa 11
United States  11
Malaysia 11
Austria1  
India 11
Italy 1 
Mexico  1
Portugal1  
Canada 11

 

Our Main Category to be considered is "A". For countries, where we dont have data for Category "A", then the value for that would the Average Value of Category B & C.  For Countries like South Africa, United States, Malaysia, India, etc., dont have Category A data. For that, we need include the Category as "A" and add the corresponding value as Avg(Category B, Catgeory C). 

         Here Country & Category is used as a slicer. So if we select "South Africa" in Country slicer, then in Catgeory slicer it should show all 3 categories, instead of showing Category B & C which have data for that country. How can we achieve this? Please provide a PBIX file with solution / DAX in achieving this requirement. 

 

This is an urgent requirement to be done in priority today. Please help me with your solutions to get it fixed soon. Thanks in advance !!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You can try to use IF function. Because I don’t know how your average is calculated, I use text instead.

Measure = IF(MAX('Query1'[A])=1,"Average measure1",IF(MAX('Query1'[B])=1||MAX('Query1'[C])=1,"Average measure2"))

 15.png

 

 

 

Best Regards,

Stephen Tao

 

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
Anonymous
Not applicable

Hi @Anonymous ,

 

You can try to use IF function. Because I don’t know how your average is calculated, I use text instead.

Measure = IF(MAX('Query1'[A])=1,"Average measure1",IF(MAX('Query1'[B])=1||MAX('Query1'[C])=1,"Average measure2"))

 15.png

 

 

 

Best Regards,

Stephen Tao

 

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

 

lbendlin
Super User
Super User

Easiest is to fill the gaps in Power Query.  Your display requirement is unclear.  Consider showing all categories at all times.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.