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
kpl_999
New Member

Visual Suggestion

In the attached file, there is a visual which I need to create in Power BI. The problem is the individual is getting filtered by country and category. I can create individual visuals to filter them individually in the Dax statement but the problem is when the new country will come in the dataset then this will fail and automatically visuals will not be filtered or created. I will have to create the visual for a particular country each time a new country is added.

 

Any alternatives?

image002.png

 

Regards,

Kaushlendra Mishra

www.powerbitalks.com

 

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @kpl_999 

Why when the new country will come in the dataset then this will fail and automatically visuals will not be filtered or created?

If you drag country field into visual, it should be updated after dataset refresh.

Could you please share your sample pbix file for us have a test?

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AllisonKennedy
Super User
Super User

@kpl_999
sorry but I don't understand your question, did you mean to attach a sample file with your data model?

What does your data table look like? If you have the data model set up correctly you shouldn't need to create a new measure for each country, just need a DimCountry table perhaps to handle this?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

pranit828
Community Champion
Community Champion

Hi @kpl_999 

 

I would write two DAX formulas for both as one will serve for Country and the other for category.

It will be better if you provide your table structure with sample data of all the columns used in the screenshot. this helps you get the exact solution rather than multiple replies asking for different information about data.

 

So, I am not sure how you are geting all the columns in the report. Considering they are all in rows for each country and categorywise and is calculated using a measure named measure_x and average is required for display.

_country_level = Calculate(AVERAGEX(table,table[measure_x]), ALLEXCEPT(table,table[country]))

_category_level = Calculate(AVERAGEX(table,table[measure_y]), ALLEXCEPT(table,table[category]))

If required, you may have to create a calculated field for each column and use SUMX, MAXX, AVERAGEX as required.

 

By using the above calculation you will not have to worry about new country or category.

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

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.