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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Filters

Hey everyone

 

I am very new to power bi especially DAX. I have a question. 

So I am using a small subset of adventure works database. and what i want to do is 

1. Find out top 10 customer per region.

 

I have 4 tables

Dim Customer(First Name,LastName etc)

Dim Geography(CountryRegionCode,City,StateProvince etc)

DimProductCategory(EnglishProductCategoryName,FrenchProductCategoryName etc)

FactInternetSales

 

What I want to do is

I want to use matrix table . I want to show it like this

Rows:-

Full Name(I have created the dax for full name)

followed by calculated column productcategoryname.

(so the calculation should be as follows:-

if the customer is a french customer then FrenchProductCategoryName should be selected else EnglishProductCategoryName

should be selected)

from DB prospective DimCustomer is joined by DimGeography table using Geography Key.

Columns:-

EnglishCountryRegionName

FrenchCountryRegionName

 

Values:- SalesAmount

 

Is it possible to achieve this in dax. I think we can create a slicer to achieve it, but I dont want that. I want this purely in dax.

Not sure how. Any help can be appreciated.

 

Regards

Farhan Jamil

 

 

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 

There is a option in the filter panel where you can set top or bottom N value of a field.

toporbotton.JPG

With just text descritpion, it is difficult to understand your model and you are unlikely get a correct solution for this kind of multi-table model question that requires complex dax calculations. I would recommend you to post with a sample pbix, so we can test on it.

 

Read this post to see how to get your answers quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards
Paul

Anonymous
Not applicable

Hey Paul

 

Apologies for coming back late. But Basically as mentioned earlier I have a small subset of adventure works database which has tables like dimcustomer,dimgeography,dimproduct,dimproductcategory,dimproductsubcategory,factinternetsales. 

 

I am creating a visual which is top 10 customer per sales amount per region

and what I want is 

If i have a french customer then I want frenchproductcategorylabel to show up, if english then english. This can be achieved in sql by putting a case statement like 

case when b.CountryRegionCode = 'FR' then f.FrenchProductCategoryName else f.EnglishProductCategoryName end as 'ProductCategory',

 

I am not sure how to achieve this in power bi. 

 

I dont know how to attach .pbix file in this community as i am very new to power bi and this community.Hope I am clear in the requirement 

 

 

 

 

Screenshot

 

screenshotscreenshot

 

for example adriana gonzalez, she is french customer, so i want the french productcategory detail label to show up, for Jordan turner I need english product category detail label to show up.  I am using matrix to show the visual.

Anonymous
Not applicable

HI Paul 

 

I think i figured out how to attach .pbix file. I have attached it in one drive.Hopefully it should be ok for you to download

 

https://onedrive.live.com/?id=48C622BA403CA81%21103&cid=048C622BA403CA81 

 

Hope their is a clear picture now

 

Regards

Farhan JAmil 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.