except
4 TopicsReturn Items that have Neither Item Selected
A DAX Puzzler: I have an inventory problem I'm trying to solve. Each location has inventory in a table TableQOHRemoveZeros. If I select the items in the slicer, I want it to return locations that have NEITHER item. E.g. if I select iPhone 12 and iPhone 13 in the Slicer, the only location that should return is Location 114 Plum Lane. DISTINCT(TableQOHRemoveZeros[Device Name Short]) I thought that I could query this table after the items were selected against all of the locations using Except, but I don't think it's possible to query a table created by slicer selection. LocationsWithoutSelectedDevices2 = VAR SelectedLocations= ALLSELECTED(DisDeviceNameShort[Device Name Short]) VAR AllLocations = All('Current Hierarchy'[Sales Code]) Var ExcludeSelectedLocation = EXCEPT(SelectedLocations,AllLocations) Return (ExcludeSelectedLocation) Error:"A table with multiple values was returned when a single value expected" A real doozy. Any way to achieve this? I think it would have huge benefit to others as well and would greatly streamline a process like this. Sales Code Location Device Name Short 111 123 Main St iPhone 12 111 123 Main St Iphone 16 111 123 Main St Iphone 11 112 111 Elm St Iphone 10 112 111 Elm St Iphone 13 112 111 Elm St iPhone 14 114 800 Plum ln iPhone 15 114 800 Plum ln iPhone 16 114 800 Plum ln iPhone 17Solved1.3KViews0likes6CommentsUSING THE EXCEPT & CONCATENATEX FUNCTIONS TO OUTPUT A LIST OF EMPLOYEE NAMES
Hi, The Matrix below shows a count of employees by reporting week. I would like to be able to output a list of employee names when comparing 2 reporting weeks to identify what names appear in one week but not the other week. Ideally I would like to output this list via a drillthrough. I have tried using a combination of CONCATENATEX & EXCEPT as suggested by Greg_Deckler on a diferent thread, however, I haven't been successul in getting it to work. It makes sense to me that those functions would be part of the solution. Please refer to the screenshots below. Any advice would be greatly appreciated. 🤗 Regards, Karin Sample PBIX: https://drive.google.com/file/d/18igYaWq6okSlcbtWHAbmhFMWVU3ZpO_6/view?usp=drive_link Desired Output of Drillthrough Desired Output of DrillthroughSolved1.4KViews0likes6CommentsALLNOTSELECTED with EXCEPT but not using FILTER Function
Hi all, I have a two part question. I am trying to write an ALLNOTSELECTED schema as mentioned below. Opposite of ALLSELECTED? (ALLNOTSELECTED) For some reason, the function does not work as expected in my DAX code. I have found at least two ways of writing it, but it uses the Filter function. I would like to avoid the filter function for the various reasons mentioned here. Can anyone help me come up with a way I can use my row context (driver_id) as essentially a reverse filter without using the FILTER function? I want it to include every driver_id for a specific trip_id except for a the driver_id in my row context. I'm attaching a sample PBIX for reference. Thanks so much in advance! Will make sure to mark as solution if it is helpful:)583Views0likes1CommentCalculate attrition with distinct clients ids
Hello Experts, I have a report table with : - Multiple Report periods with same values (one by reseller active contract over period): 01/01/2021,01/12/2021,01/11/2021 .... - Those resellers can have multiple contracts with the same reference for the same period. I must retrieve the distinct lost contracts from previous periods ( month -1, month -2 ...) I have tried comparing two results with except but i don't know why this is not working as it doesn't return correcly my reseller ref. Attrition M = var _Q = SELECTEDVALUE(Revenue[Period]) var _Q_1 = DATEADD(Revenue[Period],-1,MONTH) var _Resellers = CALCULATETABLE(DISTINCT(Revenue[Reseller Ref]), FILTER (ALL(Revenue[Period]), Revenue[Period] = _Q)) var _Old_resellers = CALCULATETABLE(DISTINCT(Revenue[Reseller Ref]), FILTER (ALL(Revenue[Period]), Revenue[Period] = _Q_1)) RETURN COUNTROWS( EXCEPT(_Old_resellers,_Resellers) ) I give you a sample with my queries in attachment: powerbi_sample Regards.916Views0likes2Comments