March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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
@Anonymous
There is a option in the filter panel where you can set top or bottom N value of a field.
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
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
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.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |