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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MustafaHaider
New Member

Other Products then selected in the filter

ClientGroupClientNameProductIdProductGroupProduct_NameOrderDateQuantitySalesAmount
AgencyABC Ltd15AAbC22/12/2022123
AgencyABC Ltd15AAbC22/12/2022323
AgencyABC Ltd15AAbC24/10/2023123
AgencyABC Ltd15AAbC19/12/2023123
AgencyABC Ltd15AAbC19/12/2023323
AgencyABC Ltd27BDEF05/12/2022150
AgencyABC Ltd27BDEF05/12/2022250
AgencyABC Ltd27BDEF24/10/2023150
AgencyABC Ltd27BDEF29/11/2023150
AgencyABC Ltd27BDEF29/11/2023250
AgencyABC Ltd27BDEF19/02/2024250

 

I have got this sample data set

I have got filter on Product Group, if user has selected Product Group A I would like to show this in table visual

This is for selected product group total value for a product if multiple products are there those will come in the table.

ClientGroupClientNameProductNameAmount
AgencyABC LtdAbC115

 

In second visual i would like to see other than selected product group

ClientGroupClientNameProductNameAmount
AgencyABC LtdDEF300

 

I am struggling to get the second visual. could you please help.

2 ACCEPTED SOLUTIONS
v-cgao-msft
Community Support
Community Support

Hi @MustafaHaider ,

Consider creating another separate table:

vcgaomsft_0-1710743036577.png

And then please create a new measure:

Amount = 
VAR __selected_values = ALLSELECTED('Table'[ProductGroup])
VAR __result = CALCULATE(SUM('Table 2'[SalesAmount]), NOT 'Table 2'[ProductGroup] IN __selected_values)
RETURN
__result

Output:

vcgaomsft_1-1710743146133.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly--How to provide sample data in the Power BI Forum--China Power BI User Group

View solution in original post

You can easily do a filtering TopN as in the screenshot below. However, depending on your data, it may return weird results. In that case it would be better to use a TopN measure.

topn_3.jpg

View solution in original post

8 REPLIES 8
v-cgao-msft
Community Support
Community Support

Hi @MustafaHaider ,

Consider creating another separate table:

vcgaomsft_0-1710743036577.png

And then please create a new measure:

Amount = 
VAR __selected_values = ALLSELECTED('Table'[ProductGroup])
VAR __result = CALCULATE(SUM('Table 2'[SalesAmount]), NOT 'Table 2'[ProductGroup] IN __selected_values)
RETURN
__result

Output:

vcgaomsft_1-1710743146133.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly--How to provide sample data in the Power BI Forum--China Power BI User Group

Apologies one more thing to add in this, e.g. 

If  Product Group A has got other products ABC, D, E, F

Client ABC Ltd, Already have got ABC product.  I would like to exclude those product which existing clients already have got in the same product group.  So result in the suggested product should be D, E and F. i.e. Upsell. How can I do that. 

In above solution it will show other product groups than selected. but also shows the products Client already have got, so i would like to exclude those products which client already have got.

Thank you so much for providing this solution, as I have a got a lot of Products, in Amount Measure, I would like to have TOP 3 only, how can I do that? I was checking in Visual filters it was not working.

You can easily do a filtering TopN as in the screenshot below. However, depending on your data, it may return weird results. In that case it would be better to use a TopN measure.

topn_3.jpg

MNedix
Solution Supplier
Solution Supplier

You can find the pbix here - https://we.tl/t-9kobo7kpcv but I didn't really do more than what I previously stated.

By the way, if this solved your probelm then please mark it as a solution so others can see it.

 

MNedix
Solution Supplier
Solution Supplier

How do you want the second visual? What shape/format? I replicated your problem and made it a card.
Since you said you are using the Product Group as a filter, I just created a measure as below:

Remaining Value = 
var _selected = CALCULATE(
    SUM(Sheet1[SalesAmount]),Sheet1[ProductGroup] = SELECTEDVALUE(Sheet1[ProductGroup]))
var _all = CALCULATE(SUM(Sheet1[SalesAmount]),REMOVEFILTERS(Sheet1))
RETURN
_all-_selected

The 1st variable calculates the amount of the selected product (based on the Product Group filter). The 2nd variable is the total amount. The result is simply the difference, shown as a number in a card (see attached).

 

Screenshot 2024-03-15 183707.jpg

 

If it works, please give it a kudos so others can see the solution.

THanks for your reply, in second visual I want Sales value by product Group Client has bought other than selected. Pie chart should do the job, it will have product groups and sales values.

 

Pie chart should show in this case product group B, and Value will be 300. 

If there are multiple clients like in data i do have that scenario, can i do top 3 by sales value i.e. only show top 3 product groups by sales value. 

Please share pbix file so i can see the relationships you have created. that will help to understand. thanks.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.