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

Slice by Measure from other measures

Greetings,

I want to be able to filter on a measure value in my table visual but no tutorials are working. I have a Power BI report that has eight measures that will return a string with an error reason with the data such as "Duplicate Entry" or the "Item does not exist in the master data". I then have a measure called Errors that becomes a column on a table that for each row shows the type of error in the data.

 

Example:

Order IDProduct No.AmountErrors
11£2Item does not exist in the master data
22£3Item does not exist in the master data
33£4Item does not exist in the master data
44£5Duplicate
54£5Duplicate

 

I've followed the following tutorials:

https://www.youtube.com/watch?v=AZAL-QPn5Zc

https://www.youtube.com/watch?v=xO9Caya9Qxw

https://www.youtube.com/watch?v=AHiCE1N0XHE

 

None of them works, when I place the below filter measure in the table it filters only the column but not the whole table, when I remove the filter measure column from the table and apply has no effect when I apply changes to the slicer.

 

This is my DAX:

 

 

 

Filter Status = 
VAR _filterValue = SELECTEDVALUE(Errors[Error])
VAR _errorValue = 'Invoice'[Errors]

VAR _result = 
    SWITCH(
        TRUE(),
        _errorValue = _filterValue, _errorValue,
        ISBLANK( _filterValue ), _errorValue,
        BLANK()
    )
RETURN
    _result

 

 

 

 

What am I missing with this? The best results I got was from https://www.youtube.com/watch?v=8Nt6sHJE_RE

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @

 

when I place the below filter measure in the table it filters only the column but not the whole table

I understand what you said not very clearly, but I think this maybe the other measure, you used in this measure, doesn't use all(table) to remove the filter, so the result will be affected by current filter.

Or you can change the number to mark the statue avoid make some mistakes in the filter.

Filter Status =
VAR _filterValue =
    SELECTEDVALUE( 'Error'[Errors] )
VAR _errorValue = 'Invoice'[Errors]
VAR _result =
    SWITCH(
        TRUE(),
        _errorValue = _filterValue, 1,
        ISBLANK( _filterValue ), 2,
        3
    )
RETURN
    _result

 

When you filter the statue ,you can just use is like the following show:

vchenwuzmsft_0-1635128269168.png

 

 

If I understood  you , please provide your pbix without sensitive information information and the expect result.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @

 

when I place the below filter measure in the table it filters only the column but not the whole table

I understand what you said not very clearly, but I think this maybe the other measure, you used in this measure, doesn't use all(table) to remove the filter, so the result will be affected by current filter.

Or you can change the number to mark the statue avoid make some mistakes in the filter.

Filter Status =
VAR _filterValue =
    SELECTEDVALUE( 'Error'[Errors] )
VAR _errorValue = 'Invoice'[Errors]
VAR _result =
    SWITCH(
        TRUE(),
        _errorValue = _filterValue, 1,
        ISBLANK( _filterValue ), 2,
        3
    )
RETURN
    _result

 

When you filter the statue ,you can just use is like the following show:

vchenwuzmsft_0-1635128269168.png

 

 

If I understood  you , please provide your pbix without sensitive information information and the expect result.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks _chenwu zhu,

Legend! It works now, cheers 🙏

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.