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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
cris007
Frequent Visitor

filter columns and rows of a matrix

Hi all, 

 

Let's say I have the below dataset : 

 

BrandValueCompetitor
Audi5000No
Skoda4000No
VW6000Yes
BMW4000Yes
Peugeot3000Yes
Tesla5000Yes
BYD4000Yes
Citroen1000Yes

 

 

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 : 

 AudiSkoda
VW  
BMW  
Peugeot  
Tesla  
BYD  
Citroen  

 

 

Anyone knows how I can create a dax to filter my rows and columns? 

 

 

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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)

vyangliumsft_0-1688617536654.png

2. Result:

vyangliumsft_1-1688617536655.png

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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)

vyangliumsft_0-1688617536654.png

2. Result:

vyangliumsft_1-1688617536655.png

 

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

OwenAuger
Super User
Super User

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


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.