filter two tables
4 TopicsI need to filter à column by another Column in my RLS
Hi, I have two tables and I need one to filter the other but i tried several methods and it doesn't work for apply my dynamic RLS. I have already filter the list of CODE_CP (in tec_tab_regroupement) by the user email. I need the list in the table Tec_Tab_Regroupement[CODE_CP] to filter a more complete list in the table Tec_bridge_Ref[CODE_CP]. Thanks for your help GuillaumeSolved528Views0likes1CommentDax to find correct name from two tables
Hello All, I have two data sets one is the ALL orders Table which contains both Product delivery and Product return records and the other table is the Return Data table which contains info about products which only returned by customers. I am trying to get the right Delivery driver's name and Pickup driver's name from these two data sets. Output: Adding a Delivery driver's name and Pickup driver's name columns to the Returns table. The sample dataset and explanation using various scenarios are as follows: Scenario 1: 1. The Order number contains multiple products and was delivered initially by the driver, John (delivery driver), on 09/21/2022. The customer returned all products The **bleep** up driver ( Max) on 09/23/2022. 2. After that the new products are delivered again to the customer on 09/25/2022 by Jose (New Delivery Driver). The customer returns one product (A1234) on 09/26/2022 to the picky driver ( Carlos). So I want to show respective Drivers based on the date. Scenario 2: The driver picked up a return that was initially delivered 2 years back. Therefore The orders table doesn't contain data. So the Delivery measure should show blank. Scenario 3: 1. Driver picks up the product on 09/27/2022 but he updates the system on 09/28/2022. The sample data: All Orders Table: Order No Item Number Date Driver Name 85629 A1234 9/21/2022 John Scenario 1 85629 B123 9/21/2022 John Scenario 1 85629 C1245 9/21/2022 John Scenario 1 85629 A1234 9/23/2022 Max Scenario 1 85629 B123 9/23/2022 Max Scenario 1 85629 C1245 9/23/2022 Max Scenario 1 85629 A1234 9/25/2022 Jose Scenario 1 85629 B123 9/25/2022 Jose Scenario 1 85629 C1245 9/25/2022 Jose Scenario 1 85629 A1234 9/26/2022 Carlos Scenario 1 68956 D-1898 9/26/2022 Steve Scenario 2 58694 F898 9/26/2022 Daniel Scenario 3 58694 F898 9/27/2022 Miguel Scenario 4 * Scenario's are not in original table used for explanation. Return Table: Order No Item Number Return Date Delivery Driver Name PickUp Driver Name 85629 A1234 9/23/2022 John Max Scenario 1 85629 B123 9/23/2022 John Max Scenario 1 85629 C1245 9/23/2022 John Max Scenario 1 69523 A1234 9/26/2022 Jose Carlos Scenario 2 68956 D-1898 9/26/2022 Steve Scenario 3 58694 F898 9/28/2022 Daniel Miguel Scenario 4 Thank you so much for your help. -Shashi amitchandak Greg_Deckler parry2k667Views0likes2CommentsPower BI Report Builder / DAX-Studio dimension and fakt Filter not working as exptected
Hello, I am wondering why filtering in Dax no working as ecpected. Neither in Dax Studio nor in Power Bi Report Builder with genrated code by the wizard. Datamodel: I use a shared Power-Bi Dataset that is imported from SQL. The model is basically a star-Schema. Fact table in the middle aber dimensions like customer , company, sales or date. Linked by ID and bidirectional. Dimension tables customer company sales date The fact table sales quantity sales value cacaluated Measures sales value in EUR Problem 1: Filtering dimension by an other dimension if I create a dataset with the wizard, where I only display dimension "sales- sales ID" and set a Filter/Parameter "customer - name" to a specific customer (0011260), the salesid are not filtered by the specificy customer. It shows all salesids. Result in report builder: Code: EVALUATE SUMMARIZECOLUMNS('Umsatz Dim Auftrag'[salesid], RSCustomDaxFilter(@UmsatzDimKundeKundennummer,EqualToCondition,[Umsatz Dim Kunde].[customer],String)) Expected Result: Why filtering not working right? my workaround is to add a countrows fact table or any other calculated measure. But I think this cannot be a real solution. Problem 2: Aggregation fact not calculated measures if i create a Dataset with the wizard or event in Dax-Studio Dimension sales - salesid fact quantity count rows because of problem 1 filter: 1 salesid = 395A0000203 Result: Code: /* START QUERY BUILDER */ EVALUATE SUMMARIZECOLUMNS( 'Umsatz Dim Auftrag'[salesid] , 'Umsatz - Fakten'[qty], KEEPFILTERS( TREATAS( {"395A0000203"}, 'Umsatz Dim Auftrag'[salesid] )) , "CountRows-Fact", CALCULATE(COUNTROWS('Umsatz - Fakten')) ) /* END QUERY BUILDER */ Expected result: Code: EVALUATE SUMMARIZECOLUMNS( 'Umsatz Dim Auftrag'[salesid] , KEEPFILTERS( TREATAS( {"395A0000203"}, 'Umsatz Dim Auftrag'[salesid] )) , "SUM_QTY", sum('Umsatz - Fakten'[qty]) , "CountRows-Fact", CALCULATE(COUNTROWS('Umsatz - Fakten')) ) Why do i have to specify the aggregation again in the code? I specified my fact - qty already in Power Bi as summarize by Sum. When i create the fact as measure it surely works. But for this i have to create a simple sum measure for all my measures. greetings BenediktSolved1.4KViews0likes3CommentsDISTINCT FILTER one table by another table
I'd like to create a new table, derived from filtering an existing table by another existing table using DAX only. (I do not want to use a calculated column). Is this possible? Example: - I created a relationship between T1[ID] and T2[ID] T1: (existing) THING_ID VAL VAL2 1 X Y 1 X X 2 Y Y 9 Y Z 9 Y Y T2: (existing) THING_ID VAL VAL2 1 A AA 2 B BB 3 C CC 4 D DD 5 E EE Something like: T3 = DISTINCT( SUMMARIZE( FILTER( T1, T1[ID] NOTIN T2[ID] ), T1[ID], T1[VAL] ) ) Desired Results: T3: (new) THING_ID VAL 9 Y 9 YSolved1.2KViews0likes2Comments