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

Can't comapre measure to a table column

Hi,

 

For the life of me I just can't get this to work..

 

I have a simple report with a category filter and a table visual.

I created a measure that contains the values in filter - so far so good.

I added the measure to the table visual.

 

Here's my problem - I'm trying to compare a specific column in the table (specific rows) to the values in measure but I can't seem to figure out the syntax.

 

Here's what it looks like:

https://i.imgur.com/HcAnu53.jpg

 

The end goal is to filter out rows with different values than the measure.

 

Any help would be appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I figured it out thanks to this post:
https://docs.microsoft.com/en-us/dax/selectedvalue-function

With no SELECTEDVALUE available, I used the previous way of doing it using these 3 functions:
IF(HASONEVALUE( columnName ), VALUES( columnName ), alternateResult )

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@Anonymous 


Create the following Measure and add it to the Visual Filter of the TAble Visual and set it to 1 and apply. I assume your Category Table and Data Table are not linked, If it is linked, create a copy of the category table and use it on your slicer.

OtherCategory = 

IF( 
    SELECTEDVALUE('DataTable'[ColA]) =[MeasureBasedonFilter],
    0,
    1
)

 

Fowmy_0-1602591598456.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

I actually wanted to try and use the SELECTEDVALUE function, but it doesn't pop up when I start typing it like other Dax functions, it seems like it's missing.

I am using Power Bi desktop May 2020 (RS version).

My analysis server version is 13.0.4474.0.

Compatibility level: 1200.

 

Does it have something to do with the function missing?

@Anonymous 

You need to update it to the latest version. I am not sure what is RS Version?

You try this

OtherCategory = 

IF( 
    MAX('DataTable'[ColA]) =[MeasureBasedonFilter],
    0,
    1
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Can't use the MAX function on strings, any chance of using a different function?

By the way, I saw other people with the same problem of this function missing, even on this forum.

Anonymous
Not applicable

I figured it out thanks to this post:
https://docs.microsoft.com/en-us/dax/selectedvalue-function

With no SELECTEDVALUE available, I used the previous way of doing it using these 3 functions:
IF(HASONEVALUE( columnName ), VALUES( columnName ), alternateResult )

Fowmy
Super User
Super User

@Anonymous 

Is your Category Field in the same table or a different table?
You can provide sample data with the expected result to assist you with the question

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

It's in a different table. Unfortunately I can't attach any samples because the data is sensitive.

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.