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
annetoal
Helper II
Helper II

Filtering rows based on column contents

I am trying to make a report in PowerBI that shows the status of files in a list. The rows in the dataset are being pushed into the table from a connector in Flow. So I want to show a file as Pending only if it hasn't later been Approved or Rejected.

 

Each file has a uniqie ID. My idea was to filter the Pending row if there is an exact match in the FileID column. In a PowerBI report, how can I only display the row that says Pending when there is not a duplicate number in FileID for Approve or Reject?

 

In the example below, I only want to show the Approve row for upload-demo.docx, the Reject row for test-send.xlsx, and the Pending row for export.site.txt. Please help!

 

FileIDFilenameStatus
5MFIYUS2upload_demo.docxApprove
5MFIYUS2upload_demo.docxPending
M3R33DJLtest-send.xlsxPending
M3R33DJLtest-send.xlsxReject
CYFH25YPexport-site.txtPending
2 REPLIES 2
Greg_Deckler
Super User
Super User

You are going to need a flag column or measure along the lines of:

 

Flag Column =
  VAR __Statuses = SELECTCOLUMNS(FILTER('Table',[FileID] = EARLIER([FileID]),[Status])
RETURN
  SWITCH(TRUE(),
    [Status] = "Approvied" || [Status] = "Rejected",1,
    NOT("Approved" IN __Statuses) && NOT("Rejected" IN __Statuses),1,
    0
  )

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you for the code. Since this is a report coming from a streaming dataset, won't I be limited to just the one table 'RealTimeData'? PowerBI won't allow the table Statuses in the report with the table made from the streaming dataset. Apologies for the noob questions.

 

Anne

 

 

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.