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
Anonymous
Not applicable

Help with shaping data

I'm attaching a pbix file where everything is setup for help. Basically, I need a slicer to group data and split them by a column. The data has 3 columns:

Shopper

Product
IsPurchase

 

A user needs to select a product from a slicer, and I need a table to show products and count of shoppers that have IsPurchase=1 for the selected product in the slicer, but IsPurchase=0 for the product in the row. 

 

If you open the pbix file and look at the data, you will see better what I need help with 🙂

 

Here is the file: PBIX

 

THANKS!

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

A slicer narrows the portion of the dataset shown in the other visualizations on the page. Slicers are used to filter the rows in table. When you select the product A, it will only return the result based on product A rows, while we are not able to get product B and C. Please review the following screenshot.

1.png

 


Best Regards,
Angelia

Anonymous
Not applicable

Thanks for the reply Angelia (@v-huizhn-msft). My question is how can I filter shoppers that have at least one row with the selected product from the slicer. It doesn't have to be slicer, but any kind of thing that will help me achieve this (DAX perhaps to group by?)

 

Looking forward to your response.

Hi @Anonymous,

You'd better create a measure use the following formula.

Measure = CALCULATE(COUNTA(Sheet1[Product]),FILTER(Sheet1,Sheet1[IsPurchase]=1))


Then create a table, select the product and meaure as row level. You will get that how many the shopper purchase the product.

1.png
While in Power BI desktop, you can't get ProductB and ProductC when you filter product A .

Best Regards,
Angelia

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.