relationship
14 TopicsFilter two tables on Multiple Criteria
Hello! this might be confusing and I can't share any data so I will do my best! I have two tables: SynthesizedItems and Failures. I have a report page dedicated to fail rate. This is just the number of fails/number of synthesized items. (measures in the failure table) Originally, I linked the two tables to a common date table. this allowed me to see the fail rate adjusted based on the users filtering by date. Then, I realized I needed to be able to break this down further. I added an additional table called DepartmentFilter and linked it to department in both the fail and synthesis tables. this seems to work. Now my question. My report has SEVERAL factors involved that users can slice their data by (all coming from the failure table) and I noticed that if the user filters to a certain customer, the fail table will filter but not the synthesized items table. (makes sense because they are not related, although customer exists as a field in both tables). Is it possible to make this method work where any filter the user applies will affect BOTH tables and therefore give an accurate rate? Is there a limit to how many common "filter" tables I can create and link to both? Is there a way to do it other than creating tables for each field? really trying to avoid this since it would be about 10 fields.1.6KViews0likes9CommentsDAX formula IF measure returns null value then search ID and match with another table ID
I need Expert support on below query. I've made below table using existing datasets and measures, which gives me SW_PART value against each of opportunity using multiple criteria. Now, I want next level DAX calculation to merge/show single row which is first row, the calculation should give me second row result into First row, I mean value 5720 (under OPP-10225) -should be visible/copy to OPP-10236 and later I will hide the OPP-10225 from the table visual. SW_PART is already a measure Opportunity ID Opportunity Name End Customer Name SW_PART OPP-10236 VD OPS_Support Apple OPP-10225 VD OPS Apple 5720 OPP-10237 MD OPS_Support MS OPP-10226 MD OPS MS 8890 OPP-10238 DD OPS_Support Virgin OPP-10227 DD OPS Virgin 23345 To identify the correct opportunity ID, I've made below excel table, which I've already imported to PowerBI. This table help to identify the which NULL Opportunity ID from above table matches Original OPP_ID to this table then search Product OPP_ID = Opportunity ID and get the value or calculate value then return the value against Opportunity ID Original Opp_ID Product OPP_ID Product Quote _PK Quote ID OPP-10236 OPP-10225 TST-024693 7D1E2089-3CF9-ED11-8F6E-6045BD11F57A OPP-10108 OPP-10425 TST-025442 BFB78603-F7B8-ED11-B596-00224801E567 I've used below DAX but it's showing same values in against all NULL opportunities SW_PART_Filled = VAR ValuefromOPP_ID = CALCULATE( [SW_PART], FILTER( ALL('Quote Details - All Records'), 'Quote Details - All Records'[_FK Quote ID] = MAX('VN-OPP Identifier'[_PK Quote ID]) ) ) RETURN IF( ISBLANK([SW_PART]), ValuefromOPP_ID, [SW_PART] ) Results I am getting as below, which showing same results against opportunity Opportunity ID Opportunity Name End Customer Name SW_PART OPP-10236 VD OPS_Support Apple 5720 OPP-10225 VD OPS Apple 5720 OPP-10237 MD OPS_Support MS 5720 OPP-10226 MD OPS MS 8890 OPP-10238 DD OPS_Support Virgin 5720 OPP-10227 DD OPS Virgin 23345Solved934Views0likes3CommentsRelationship issues showing BLANK values
Hi All, I built a quick model with a lot of rows (10 million). The model analyses the YOY variances per product product group. A product reference is linked to a product group. In some cases, the data might have mistakes and 1 reference is linked to multiple product groups. For some reasons, I can see some "(blank)" values and I don't understand why. When I click on the revenue, it shows nothing as if it is empty. Could you please help? Thanks so much for your assistance!Solved1KViews0likes3CommentsDAX code filtering tabled based on selected value (show other values)
Hi all, I have an issues to which I cannot find the solution. I hope someone can help me out. I've created an example dataset to explain the problem: customers order food and drinks in a restaurant. They can order multiple types of food and drinks during 1 visit. Here is a sample of 5 different customers with their orders: I can edit this table to make it a one record per customer list: Now what I would like to know is when I select one item in a slicer/filter, what are the other most ordered items per type (food/drinks) based the customers that ordered the selected item? Example: I select as item Fries. Customer B, C and E ordered Fries. During the same order, they also ordered other food and drink items. I want to count the number of times the other items were ordered to see which item is most often ordered together with fries. This is what I would like to see then: My thoughts were to first create new DIM table with the type and item combinations (a food and drinks list) which can then be used for the filter. I can create a relationship between the new DIM table and the FACT table in the model view so that I can filter the customers with orders that contain the selected item. Then I somehow need to use this list of selected customers to filter another table (a copy of the original FACT table with all the customers and their order information?) so that I can see the whole order of these customers. And then I can create a visual of the number of items, per type, in which I exclude the selected item. I hope someone can help me out 🙂 Many thanks, AnneSolved1.2KViews0likes5CommentsCalculated column if date is within last 7 days using Calendar Dimension
I have two tables. One is a Calendar Dimension the other has values in it. They are linked by an ID, and I need to create a 'flag' to determine whether the value row is in the past 7 days, but I can't seem to get the relationship to work. I tried using USERELATIONSHIP and RELATED and RELATEDTABLE, but maybe I'm unable to get it to work. Calendar Dimension: Id Date 1 01/01/2021 2 02/01/2021 .. .. 4 20/01/2021 5 21/01/2021 Values table: Value DateID InPast7Days 500 1 0 -400 2 0 900 5 1 What i want is to use the relationship, to add the column with the 0's if the date is not within the past 7 days, and 1 if it is within the past 7 days. Hope this makes sense, and that you can help 🙂Solved8.3KViews0likes4CommentsColumn is showing correct total but row level sum is blank
I have a column which is budget amount coming from budget table. There is a relationship exists between budget and orders via product and when I use that column inside fact orders, I am not getting row level data (I am expecting atleast same values if relationship issue ) but total is showing correct valueSolved1.9KViews1like1CommentHow to use columns as filters from different tables for measures
Hello! I have created a measures table (measures_counts_by_date) which has counts for number of occurences based on the date from another table (litigations). It works in reports when I am using columns only from the litigations table. However, I would like to use columns from other tables such as sightings , producers etc. for my reports. As I have seen this does not work with the measure. The measure is calculated in the following way: closed_count = CALCULATE(COUNT(litigations[id]), USERELATIONSHIP(dates[Date],litigations[closed_at])) Should I somehow create a relationship between my measures table and the other tables in order to be able to use columns from other tables? I will be happy if you share the best practice in this scenario. Many thanks!Solved609Views0likes1CommentFilter context not passing onto measure
Hi Power BI Brains! I need a bit of help please, I've been stuck on this problem and don't fully understand why it's happening. I've got a dataset that contains a Calendar table and a Sales Detail fact table that have a one to many join between them, single direction from Calendar to the Sales table. I've created a table of explicit measures: a set of measures for the current year and a set for the previous year (based on the dates in my Calendar table where each calendar date has a YOY date in the financial year which does not align with the standard gregorian calendar). Sales Unit Va lue= sum('Sales Daily Detail'[Invoiced Sales Unit Value]) Sales Unit Value LY = var _MaxDate = CALCULATE(MAX('Sales Daily Detail'[YOY Event Date])) var _MinDate = CALCULATE(MIN('Sales Daily Detail'[YOY Event Date])) RETURN CALCULATE([Sales Unit Value],ALL('Sales Daily Detail'),'Sales Daily Detail'[Event Date]>=_MinDate&&'Sales Daily Detail'[Event Date]<=_MaxDate) The LY measure works as intended, it's supposed to be flexible so that when the user uses the dataset for self-serve queries they can use the LY metric for whatever date range they need. If I filter the Calendar table with a slicer, I get the correct LY value, happy with that part. But... this is where the problem comes, I then I created a DateSelections table as per this video (https://www.youtube.com/watch?v=fKygF7VEJnQ) to provide my users with a pre-defined list of time periods they can select in the report as well as a Custom Date range, because this dataset is also used for a lot of dashboards. The DateSelections table that I created for my pre-defined periods has a one to many relationship filtering both ways to the Calendar table and has *no* relationship to the fact table. If I select let's say "Week to Date" on my dropdown using DateSelections then it goes and filters my Calendar table which then correctly filters my Sales Fact table and returns the correct Sales Unit Value. Here's the weird part... Sales Unit Value LY goes blank! If I create a slicer that has any field in from the Calendar table and I use that to filter the sales fact talbe, Sales Unit Value LY is correctly returned. If DateSelections filters Calendar and Calendar filters Sales fact then why is the Sales Unit Value LY metric not populating at all when I make a selection in DateSelections? I am quite confused, I suspect it's to do with not being able to pass a filter context onto a second table or something? I tried adding an inactive relationship between DateSelections and the Sales Fact and then use USERELATIONSHIP but the problem persisted. Any thoughts on what I'm doing wrong??Solved9.5KViews0likes8CommentsPowerBI dataset simple relationship issue
Hello guys, I am unable to understand why I cannot create visuals with data from my two fact tables joined through a dimension table. The schema is described below, I joined the two tables through a dimension based on the same id. If I want to create a visual in which I pull attributes from Fact One and Fact Two, i get an error saying there is no valid relationship between the tables. I tried switching the cross filter direction to 'both' for both relationships: did not work. Tried to pull attributes from all three tables, thinking that maybe all three tables have to contribute to the visual for it to work. Same issue. The only way I can link the two tables in the same visual is by doing a many to many relationship between the two fact tables. What am I doing wrong? Also, I have a similar issue with products table where I am linking Fact Two to Product table (fact:many to product:one), then linking Product dimension to Product Options dimension (Product:one to Product Options:many). I cannot split the fact table sales data by Product Options. The only way to make it work is again, doing a many to many relationship between Fact Two and Product Options. Please help!659Views0likes2CommentsCreating relationship between two tables using null calculated columns SSAS
Hi! I'm having a problem of recreating a solution that my previous colleage did and nobody has no idea what the solution really means. There are two tables in tabular model: a dimension (D) and a fact table (F) which have the same source but each table contains different number of attributes. Each table contains a calculated column "Link" which has no expression: These two tables has a relationship (Many to one, Both Directions) using these two calculated columns: How does it even work? Even though I don't understand the logic, I tried to recreate this solution using another two tables, but I'm getting an error: Link column contains a duplicate value null and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table. Can somebody please explain what is going on and why am I getting an error while trying to recreate almost the same thing that actually works? Thank you in advance!Solved867Views0likes1Comment