Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
Let's say I have the below dataset :
Brand | Value | Competitor |
Audi | 5000 | No |
Skoda | 4000 | No |
VW | 6000 | Yes |
BMW | 4000 | Yes |
Peugeot | 3000 | Yes |
Tesla | 5000 | Yes |
BYD | 4000 | Yes |
Citroen | 1000 | Yes |
I want to create a Matrix for which in colomns I want to put all the brands that are not competitor and in rows, all the brands that are competitors.
So it would look as below :
Audi | Skoda | |
VW | ||
BMW | ||
Peugeot | ||
Tesla | ||
BYD | ||
Citroen |
Anyone knows how I can create a dax to filter my rows and columns?
Thank you
Solved! Go to Solution.
Hi @cris007 ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
var _table=
SUMMARIZE('Table','Table'[Brand],'Table'[Competitor])
var _tableno=
FILTER(_table,[Competitor]="No")
var _tablenotrue=
SUMMARIZE(_tableno,[Brand])
var _tablenotrue1=
ADDCOLUMNS(
_tablenotrue,"Brandgroup",[Brand])
var _tablenotrue2=
SUMMARIZE(
_tablenotrue1,[Brandgroup])
var _tableyes=
FILTER(_table,[Competitor]="Yes")
var _tableyestrue=
SUMMARIZE(_tableyes,[Brand])
return
CROSSJOIN(
_tablenotrue2,_tableyestrue)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @cris007 ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
var _table=
SUMMARIZE('Table','Table'[Brand],'Table'[Competitor])
var _tableno=
FILTER(_table,[Competitor]="No")
var _tablenotrue=
SUMMARIZE(_tableno,[Brand])
var _tablenotrue1=
ADDCOLUMNS(
_tablenotrue,"Brandgroup",[Brand])
var _tablenotrue2=
SUMMARIZE(
_tablenotrue1,[Brandgroup])
var _tableyes=
FILTER(_table,[Competitor]="Yes")
var _tableyestrue=
SUMMARIZE(_tableyes,[Brand])
return
CROSSJOIN(
_tablenotrue2,_tableyestrue)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @cris007
To be able to give a proper answer, my first question is: what values would you want to appear in the body of the matrix? Can you give an example?
Regardless, I would suggest that you need a secondary copy of a Brand dimension (possibly with inactive relationship) in order to make this work.
Regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
12 | |
11 | |
8 | |
8 |
User | Count |
---|---|
24 | |
13 | |
12 | |
11 | |
10 |