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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
PraveenGuntuka
Regular Visitor

filter using two columns

Hi,

 

We have a requirement to filter data based on two column values.

contat

Trade

source

Corporate

Salesperson

123

 $     100

SMS

Y

Y

242

 $     200

ETF

N

Y

123

 $     300

PPM

N

Y

456

 $     400

DATABREAK

Y

N

789

 $     500

SMS

Y

Y

234

 $     600

ETF

N

Y

457

 $     700

PPM

N

Y

678

 $     800

DATABREAK

Y

N

 

 

Create a formula or parameter with Corporate and Salesperson names. When Corporate is selected, report should display all the “Y” values from the Corporate column and if “Salesperson” is selected all the “Y” values from Salesperson column should display.

 

report should use single slicer /parameter to filter the data.

1 ACCEPTED SOLUTION
PraveenGuntuka
Regular Visitor

it would probably make sense to calculate a new table to handle this. The table will have two columns, Corporate and SalesPerson :

Slicer Table =
UNION (
SELECTCOLUMNS (
FILTER( 'Table' , 'Table'[Corporate] <> BLANK() ) ,
"Source" , 'Table'[Source] ,
"Selection" , 'Table'[Corporate]
),
SELECTCOLUMNS (
FILTER ( 'Table' , 'Table'[Salesperson] <> BLANK() ) ,
"Source" , 'Table'[Source] ,
"Selection" , 'Table'[SalesPerson]
)
)
After this has been calculated, create a relationship between these tables, between the Source columns. Since this is purely for filtering the table on the person of interest, make it be Many-to-Many and have Slicer Table filter Table:


Create a slicer with the Selection column from the Slicer Table and test the functionality:

View solution in original post

5 REPLIES 5
Syndicate_Admin
Administrator
Administrator

Good afternoon! I need to know the total amount I have of "Yes, "TRUE", "yes" in the RESTULT column. STATUS. For this, you need to filter the column, how? After that I need to use a measure to know the amount I have of "Yes, "TRUE", "yes".

image.jpg

Hi,

If you wish to count the Yes/true in the Result column, then write this measure

Measure = calculate(countrows(Data),Data[Result]="Yes"||Data[Result]="true")

My assumption is that true is text true (not a boolean true).

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PraveenGuntuka
Regular Visitor

it would probably make sense to calculate a new table to handle this. The table will have two columns, Corporate and SalesPerson :

Slicer Table =
UNION (
SELECTCOLUMNS (
FILTER( 'Table' , 'Table'[Corporate] <> BLANK() ) ,
"Source" , 'Table'[Source] ,
"Selection" , 'Table'[Corporate]
),
SELECTCOLUMNS (
FILTER ( 'Table' , 'Table'[Salesperson] <> BLANK() ) ,
"Source" , 'Table'[Source] ,
"Selection" , 'Table'[SalesPerson]
)
)
After this has been calculated, create a relationship between these tables, between the Source columns. Since this is purely for filtering the table on the person of interest, make it be Many-to-Many and have Slicer Table filter Table:


Create a slicer with the Selection column from the Slicer Table and test the functionality:

PraveenGuntuka
Regular Visitor

Hi @alekhved 

Requirment to use a single slicer option to filter the data.

alekhved
Resolver I
Resolver I

hi @PraveenGuntuka 

 

Based on problem description it seems like Adding two slicers with these two column should solve the purpose. Am I missing something?

 

Thanks,

alekh

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.