Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |