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

Filtering data

This may be a simple solution, but since I'm fairly new and struggling with this I figured I'd give this forum a shot.  I have a dataset of work orders.  There are various report pages related to different ways to see these work orders, opened, closed, open currently, etc.  I'm trying to produce a table with the work order detail information ONLY for those work orders which are currently open.  Also, create a measure that reflects how many days they've been open (compared to today).

 

I think I have some of this, but things aren't quite working right.  I have a measure called Currently Open Work Orders:

 

Currently Open Work Orders = CALCULATE([Vehicle Work Orders], 'WorkOrder'[Work Order Status Class] = "OPEN")

which works fine to reflect in the table whether the work order is currently open or not, (1 = currently open).  When I add certain columns to the table, like WO # , it correctly filters to only show those WO which are currently open (=1).

 

 

I also have a measure to calc the days open from the day the WO was reported:

 

Current Open Days = IF(
    WorkOrderEvent[Currently Open Work Orders] = 1,
    SWITCH (
        TRUE (),  
        TODAY () < MAX ( 'WorkOrder'[WO Date Reported] ), -1 * DATEDIFF ( TODAY (), MAX ( 'WorkOrder'[WO Date Reported] ), DAY ),
        TODAY () > MAX ( 'WorkOrder'[WO Date Reported] ), DATEDIFF ( MAX ( 'WorkOrder'[WO Date Reported] ), TODAY (), DAY ),
        0
    ),
    "")

 

This measure works to calculate the days properly, but, when I add this measure to a table with the WO details, like WO #, WO Date Reported, Status, Currently Open Work Orders, it pulls in ALL work orders (instead of just currently open work orders) and those which aren't currently open just have the blank value.  I don't want anything in this table except currently open work orders and the Current Open Days measure would ONLY apply to currently open work orders so I don't know how to reflect that.  Guessing I need to filter somewhere but not sure how to proceed.

 

Any help is much appreciated.

Thanks

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Sample data would really help. That being said, you might want to check out my Quick Measure Open Tickets which might apply in your case: https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364

 

But, if you just want to filter out the nulls, do that in the FILTERS area of your side pane over on the right.


@ 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...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Sample data would really help. That being said, you might want to check out my Quick Measure Open Tickets which might apply in your case: https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364

 

But, if you just want to filter out the nulls, do that in the FILTERS area of your side pane over on the right.


@ 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...

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.