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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Compare price

Hello I have a very simple table.
I need to pick a Country and then show price of all other countries. So, if I pick Australia, I need to see All other countrise and price, but do not show Austratia.

2018-11-23_10-09-06.jpg
Thanks

2 ACCEPTED SOLUTIONS

Should be able to use the same basic concept to create a flag variable. First, don't connect your slicer to your table. Then create a flag measure like:

 

Measure Flag = 
VAR __selected = MAX('Table'[Column]) //value from slicer
RETURN
IF(MAX([Country]) = __selected,0,1)

Filter on this measure.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Create a calculated table which lists all slicer selections. This table should be unrelated to source data table.

slicerTable = VALUES('TB1'[Country])

Add below measure to visual level filters, set its value to 0.

check = IF(SELECTEDVALUE(slicerTable[Country])=SELECTEDVALUE(TB1[Country]),1,0)

To calculate the price of selected country as a comparison, please create below measure.

value for selected country = CALCULATE(SUM(TB1[Price]),FILTER(TB1,TB1[Country]=SELECTEDVALUE(slicerTable[Country])))

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Create a calculated table which lists all slicer selections. This table should be unrelated to source data table.

slicerTable = VALUES('TB1'[Country])

Add below measure to visual level filters, set its value to 0.

check = IF(SELECTEDVALUE(slicerTable[Country])=SELECTEDVALUE(TB1[Country]),1,0)

To calculate the price of selected country as a comparison, please create below measure.

value for selected country = CALCULATE(SUM(TB1[Price]),FILTER(TB1,TB1[Country]=SELECTEDVALUE(slicerTable[Country])))

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

I wrote something like this once:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Inverse-Aggregator/m-p/342266

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I'm not looking to aggregate data, simple want to show country and price in grid mode of all other countries then the selected country. Something like this

2018-11-23_10-09-06.jpg

Should be able to use the same basic concept to create a flag variable. First, don't connect your slicer to your table. Then create a flag measure like:

 

Measure Flag = 
VAR __selected = MAX('Table'[Column]) //value from slicer
RETURN
IF(MAX([Country]) = __selected,0,1)

Filter on this measure.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

But country is coming form the same table.

Create a new table:

 

New Table = VALUES('Table'[Country])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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