Forum Discussion
Anonymous
7 years agoNot applicable
Counting a measure return
Hello, I'm linking to a previous post of mine to help give more context if needed. https://community.powerbi.com/t5/Desktop/Measures-affected-by-slicer-choice/m-p/595019#M282535 I have a ...
- 7 years ago
Hi Anonymous,
Please try a solution like below.
1. Create a new table [Sellers].
Sellers = VALUES('Table'[SELLER])2. Create a measure.
Measure = SUMX ( ADDCOLUMNS ( SUMMARIZE ( 'Table', 'Table'[ITEM ID], 'Table'[SELLER], 'Table'[PRICE] ), "ifMinPrice", IF ( [PRICE] = CALCULATE ( MIN ( 'Table'[PRICE] ), ALL ( 'Table'[SELLER], 'Table'[PRICE] ), ALLSELECTED ( 'Sellers'[SELLER] ) ), 1, 0 ) ), [ifMinPrice] )
Best Regards,
v-jiascu-msft
Microsoft Employee
7 years agoHi Anonymous,
Please try a solution like below.
1. Create a new table [Sellers].
Sellers = VALUES('Table'[SELLER])
2. Create a measure.
Measure = SUMX ( ADDCOLUMNS ( SUMMARIZE ( 'Table', 'Table'[ITEM ID], 'Table'[SELLER], 'Table'[PRICE] ), "ifMinPrice", IF ( [PRICE] = CALCULATE ( MIN ( 'Table'[PRICE] ), ALL ( 'Table'[SELLER], 'Table'[PRICE] ), ALLSELECTED ( 'Sellers'[SELLER] ) ), 1, 0 ) ), [ifMinPrice] )
Best Regards,
Anonymous
7 years agoNot applicable
Hello v-jiascu-msft
Thanks for the response.
I applied this to my data, and it works when I do not filter any sellers out in my slicer.
When something is selected in my slicer, it only filters to show the value from "all selected", not what the results would be when including all the selected sellers to find the minimum price seller.
The original table where the lowest price seller is showing the correct data, but not the visual I created from the most recent measure.
Let me know if that's not clear. Thanks!