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

Filter an unpivoted table to show rows that meet certain criteria?

I have a table with pivoted data, shown in the below images. I have created a field "MoveID" to group similar org codes together

 

jsauerla_3-1617285700300.png jsauerla_4-1617285720228.png

 

 

My objective is to create a measure that will filter to show records where MoveID has a value of Loaded, or TM queue, but MoveID DOES NOT have a value of anything else. Not Approved, Approved w/ Changes, Exported, Live, Rejected/Cancelled. So in using this measure as a filter, I can see rows where there is no Live, Approved, Exported value at all.

 

I dont want to just filter them out to not see them. I want to find rows where they don't even exist

 

jsauerla_0-1617285578608.png

 

Is this even possible? 

 

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

Hi @Anonymous ,


According to your description, you could create flag measure, then using flag as filter; the following formula to create a measure :

step 1: Add Measure (flag)

flag =
VAR a =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Org code] ),
            [Status] IN { "loaded", "TM queue" }
        )
    )
VAR b =
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Org code] ) )
RETURN
    IF ( a = b, 1, 0 )

step 2: Add filter

v-yalanwu-msft_0-1618390663233.png

The final output is shown below:

Filter an unpivoted.png

Best Regards,
Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi @Anonymous ,


According to your description, you could create flag measure, then using flag as filter; the following formula to create a measure :

step 1: Add Measure (flag)

flag =
VAR a =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Org code] ),
            [Status] IN { "loaded", "TM queue" }
        )
    )
VAR b =
    CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Org code] ) )
RETURN
    IF ( a = b, 1, 0 )

step 2: Add filter

v-yalanwu-msft_0-1618390663233.png

The final output is shown below:

Filter an unpivoted.png

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

 

 

ryan_mayu
Super User
Super User

@Anonymous 

you can create a column

check = if(ISBLANK(maxx(FILTER('Table','Table'[Org Code]=EARLIER('Table'[Org Code])&&'Table'[Status]<>"Loaded"&&'Table'[Status]<>"TM queue"),'Table'[Status])),"Yes","No")

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , Try a measure for only those two status and have both of them only

 

countx(Filter(summarize(Table, Table[MoveID] , "_1", calculate(distinctcount(status), filter(Table, Table[Status] in {"Loaded","TM queue"})), "_2",distinctcount(status)), [_1] =[_2] && [_1] =2), [MoveID])

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.