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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hidenseek9
Post Patron
Post Patron

How to create a filtered table

Hello Power BI Community,

 

I am having a trouble creating a filtered table from one big table.

In my big file, I have many columns of data, but I just would like to create

a new table with below three columns using DAX.

What is the right DAX expression to achieve this??

 

I would like to create a table with columns

1) Type, 2) Formula, and 3) Brand

 

From the big file, first I want to extract a data with "Type" A.

Now I have a data set with just Type A.

Then I want to distinct Formula, so I have a unique set of Formula for Type A.

Then I would like to have brand information associated with Formula.

 

Dummy Data

 

My desired output should look like this dummy data.

 

Appreciate your help.

 

Many thanks,

 

H

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi,

 

If I understand correctly you want a uique list for the columns Type, Formula and Brand? 

 

I cannot reach your dataset because it is on your SharePoint.. also the url can be seen maybe good to know.

Based on this "Big table".

table.JPG

 

Try this formule:

SmallerBigTable = 
SUMMARIZE(
	BigTable;
	BigTable[Type];
	BigTable[Formula];
	BigTable[Brand]
)

Result:

list.JPG

 

If your goal is to get the distinct columns you can also use Power Query, select the columns and choose "Remove duplicates".

 

My above example is a New Table based on a DAX expression. This comes handy when you also when to do a calculation for this table. Doing that it is suggested to use ADDCOLUMNS instread of doing the calculation in the SUMMARIZE function.

 

Example:

SmallerBigTable =
ADDCOLUMNS (
    SUMMARIZE ( BigTable; BigTable[Type]; BigTable[Formula]; BigTable[Brand] );
    "Count of rows"; COUNTA ( BigTable[A] )
)

Hope this helps!

View solution in original post

Anonymous
Not applicable

@hidenseek9,

 

Try this:

 

SmallerBigTable = 
SUMMARIZE(
	FILTER(
		BigTable;
		BigTable[Type]="A"
		);
	BigTable[Type];
	BigTable[Formula];
	BigTable[Brand]
)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi,

 

If I understand correctly you want a uique list for the columns Type, Formula and Brand? 

 

I cannot reach your dataset because it is on your SharePoint.. also the url can be seen maybe good to know.

Based on this "Big table".

table.JPG

 

Try this formule:

SmallerBigTable = 
SUMMARIZE(
	BigTable;
	BigTable[Type];
	BigTable[Formula];
	BigTable[Brand]
)

Result:

list.JPG

 

If your goal is to get the distinct columns you can also use Power Query, select the columns and choose "Remove duplicates".

 

My above example is a New Table based on a DAX expression. This comes handy when you also when to do a calculation for this table. Doing that it is suggested to use ADDCOLUMNS instread of doing the calculation in the SUMMARIZE function.

 

Example:

SmallerBigTable =
ADDCOLUMNS (
    SUMMARIZE ( BigTable; BigTable[Type]; BigTable[Formula]; BigTable[Brand] );
    "Count of rows"; COUNTA ( BigTable[A] )
)

Hope this helps!

@Anonymous

 

SmallerBigTable = 
SUMMARIZE(
	BigTable;
	BigTable[Type];
	BigTable[Formula];
	BigTable[Brand]
)

Above formula works great, except for one problem.

 

When I put above DAX, it brings all Types. How can I reformat the DAX expression

so that it will extract just Type A?

 

Many thanks,

 

H

Anonymous
Not applicable

@hidenseek9,

 

Try this:

 

SmallerBigTable = 
SUMMARIZE(
	FILTER(
		BigTable;
		BigTable[Type]="A"
		);
	BigTable[Type];
	BigTable[Formula];
	BigTable[Brand]
)

@Anonymous

 

Perfect!

Many thanks!

 

H

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.