filtering
37 TopicsHow to filter a table column with the selection on Other Table Column
Hi, In a tutorial we have seen the following report : In the report if Customer Name e.g. Adams Blake is selected the matrix shows the Brands which were purchased by customer along with sales amount. However, in the second slicer we could not see the product names which were purchased by Adams. As we know that a filter from Customer easily reaches to Sales ( for one to many relationship) but from Sales the same is not propagated to Product because of Many to One relationship and following is the screen shot of data model: In the tutorial we have seen that the relationship between Sales and Product was made Bidirectional and after that we achieved the desired report i.e. we can see the product names along with Brands when a specific customer is selected and following is the screen shot of the same: However it is advised that the bidirectional relationship should not be activated for the entire data model as the same can create many complications and unexpected results. Now the question is what will be the formula based solution to achieve the aforesaid situation where we can see Product names along with brands when a specific customer is selected. The same has not been told in tutorial but in practical scenario we can face such setuation and this will be very helpful for us if we get a code based solution of the same. Regards, Somnath589Views0likes3CommentsShow Category only Contains Multiple Selected Subcategory
I have a Data Set like this in PowerBI- Category Total Value Sub_Category AB 100 A AB 100 B BC 140 B BC 140 C CX 90 C CX 90 X AX 40 A AX 40 A ABX 200 A ABX 200 B ABX 200 X I want to use a slicer like this- if I multi select A and B in Slicer It will show only the category which has only A and B present (Category AB,ABX from my example). How can I do it?Solved1.4KViews0likes4Commentsstatic grand total in matrix when filtered
Hi, I have a matrix with different countries as rows and Value (USD) as values. If I filter on a country, I want to keep the grand total unchanged. So in this case, if I filter on Zambia, I want it to show 103.55 for Zambia and 287,524.39 for Total. Is it possible?Solved1.5KViews0likes4CommentsSlicer for cumulative slicing
Hi Everyone, I have a dilemma . . . Is Power BI capable of cumulative slicing. For example, if I have a slicer for running total, and I select $200, I would want to see Items A, B and C instead of just Item C. Item Value Running Total Bands A $50 $50 <$50 B $100 $150 >$50 and <=$150 C $50 $200 >$150 and <=$200 D $150 $350 >$200 and <=$350 E $50 $400 >$350 and <=$400Solved1.2KViews0likes4CommentsFilter on table with measure not working
Hi, I have two tables Tab1 and Tab2 both containing one column of integer from 1 to 20 000. Goal : user select a first value (Whole Number) from Tab1[col1] with a slicer and then I want an other slicer where the user can select only values between 1 and the selected value in Tab1. I tried to get the selected value thanks to SELECTEDVALUE(Tab1), that is working I can display the choice in a table. But to filter Tab2 by doing FILTER(Tab2, Tab2[col2]<[selectedvalue]) it creates me a blanck table. Whereas if I do FILTER(Tab2, Tab2[col2]<10) it's working I have only values between 1 and 10 for instance of my Tab2. My measure is a wholenumber. I have no relationship between Tab1 and Tab2. Thanks for your help, Don't hesitate if I'm not clear, RobSolved1.6KViews0likes8CommentsDAX filtering with Slicers through multiple one to many related tables
Hi all, First time posting but any help would be greatly appreciated. I've reduced the model down to remove some complexities but still having issues pulling information correctly through tables. Schema is like a reversed star schema i.e. the fact table is the 1 on the one to many side relationship (this is the part i'm interested in): Programme table (1) => (*) Project table Project Table (1) => (*) Project Theme table Represented below with dubby data: Wider Schema In the main report I am using a table with the main element being ProgrammeReference and as expected when I use a slicer containing anything from project it doesn't filter and so I need some DAX in order to retreive the data. When I add the following visual level filter on report it filters the report BEFORE the slicer is used which isn't what I want: Linked project Cross filter slicer = CALCULATE(DISTINCTCOUNT(Programme[ProgrammeId]),CROSSFILTER(Project[ProgrammeId],Programme[ProgrammeId],Both)) So any help getting the report to filter only when the slicer is used would be very helpful. Slicer: Linked Project Stage, 'Project'[Project status] However I also need a slicer to filter the main report using fields from the Project theme table, but only after the slicer has been used, I've attempted writing some DAX of my own but it simply removes all fields from the report e.g. the below did not work: Project Theme Cross filter slicer = if( ISFILTERED('Project Theme'[ProjectThemeType]) = TRUE(), IF( Project[Linked project Cross filter slicer] > 0, CALCULATE(DISTINCTCOUNT('Programme'[ProgrammeId]),CROSSFILTER('Project Theme'[ProjectId],Project[ProjectId],Both)))) I had envisioned some kind of Measure would be required to be added as a visual level filter to the main report but open to other solutions. Let me know if more information is required! Thanks in advance Scott992.4KViews0likes9CommentsHelp! Want to filter a table if the slicer selection is in either one of 2 columns.
Hey, So for data structure, I have two tables with similar info, but they are tied together by posn number. The end goal is that the slicer will filter the table if the selection is in either of the two columns in the table. I tried to make a dimension table using 'summarize' to create the slicer, pulling all the personal trades from one table, and all the positional trades from another table. dim Trades = DISTINCT( UNION(SUMMARIZE('All Pers', 'All Pers'[Trade Name]), SUMMARIZE('POSN Trade', 'POSN Trade'[Trade Name]) ) ) It doesn't seem to be working. When I use the slicer, it's only pulling up lines that have the selected Trade name, but it's not pulling up the people that have the pers trade, in posns with a diff trade. Any ideas?Solved890Views0likes3CommentsHow to get a column from the table that is filtered by another column?
Now, my calculated table looks like this: FRU Status intermediate table = ADDCOLUMNS( VALUES('All Project v2'[Project Name]), "Flag", [stat chart] ) VALUES() here returns all values of the [Project Name] column. I need it to return values based on the column 'All Project v2'[Dashboard Created] = "Yes", so if the 'project' has 'dashboard' - return the column.Solved1.2KViews0likes5CommentsHow to filter the table by chart visual?
Hey there! So what we have here are: 1) "Status" chart 2) "Readiness" column in the table Both status chart sections and flag icons in the column are measures. A specific table is created for the chart, without any relationship to the other tables. What I want to: Whenever a user clicks on a section (say red, for example), the column in the table should display only the projects with red flag icons: For now, whenever I click on whatever section of the chart - the column doesn't get filtered. Like here: RESOURCES IF NEEDED Chart table: 1) table itself 2) color conditions Color = SWITCH('Status Chart Filter Table'[Flag], "FlagHigh", "At Plan", "FlagMedium", "Behind Plan", "FlagLow","At Risk", "FlagBlack", "Other" ) 3) table expression Status Chart Filter Table = VAR T1 = SELECTCOLUMNS ( GENERATESERIES ( 1, 4, 1 ), "Sort", [Value] ) VAR T2 = ADDCOLUMNS ( T1, "Flag", SWITCH ( [Sort], 1, "FlagHigh", 2, "FlagMedium", 3, "FlagLow", 4, "FlagBlack" ) ) RETURN T2 4) count the number of a particular color: Flag Count = VAR CurrentFlag =SELECTEDVALUE('Status Chart Filter Table'[Flag] ) VAR T1 = ADDCOLUMNS ( VALUES ( 'All Project v2'[Project Name] ), "@Flag", [stat chart] ) VAR T2 = FILTER ( T1, [@Flag] = CurrentFlag ) RETURN COUNTROWS ( T2 ) Conditional formatting expression used to mark "Readiness columns" with respective flags (if needed): _Overall_Status_Flag = VAR Unit_Readiness = [Upcoming Unit Readiness] #showing values in percentages VAR count_delimiter = LEN ( Unit_Readiness ) - LEN ( SUBSTITUTE ( Unit_Readiness, ",", "" ) ) #in the case when there are two values delimited with ",". Because conditional formatting #works on numbers only, we have to split the string (e.g. 100%, 99%) and check if they meet #conditions and assign a flag to them VAR last_Unit_Readiness_position = IF ( count_delimiter = 0, BLANK (), FIND ( "@", SUBSTITUTE ( Unit_Readiness, ",", "@", count_delimiter ) ) ) VAR last_Unit_Readiness_len = IF ( count_delimiter = 0, BLANK (), LEN ( Unit_Readiness ) - last_Unit_Readiness_position ) VAR last_Unit_Readiness = VALUE ( SWITCH ( TRUE (), ISERROR ( SEARCH ( "%", Unit_Readiness ) ), BLANK (), count_delimiter = 0, LEFT ( Unit_Readiness, LEN ( Unit_Readiness ) - 1 ), LEFT ( RIGHT ( Unit_Readiness, last_Unit_Readiness_len ), last_Unit_Readiness_len - 1 ) ) ) / 100 VAR upcoming_gates = [Upcoming Gate] # the [Unit Readiness] shows the readiness of the #particular gate VAR count_delimiter_gate = LEN ( upcoming_gates ) - LEN ( SUBSTITUTE ( upcoming_gates, ",", "" ) ) VAR last_gate_position = IF ( count_delimiter_gate = 0, BLANK (), FIND ( "@", SUBSTITUTE ( upcoming_gates, ",", "@", count_delimiter_gate ) ) ) VAR last_gate_len = IF ( count_delimiter_gate = 0, BLANK (), LEN ( upcoming_gates ) - last_gate_position ) VAR last_gate = SWITCH ( TRUE (), count_delimiter_gate = 0, upcoming_gates, LEFT ( RIGHT ( upcoming_gates, last_gate_len ), last_gate_len ) ) VAR min_p_calc = CALCULATE ( SELECTEDVALUE ( 'Unit Readiness Table'[Y_min] ), #[Y_min] is a min. the threshold value for readiness not to be red 'Unit Readiness Table'[P Gate] = TRIM ( last_gate ) # [P Gate] is a gate's name ) VAR min_m_calc = CALCULATE ( SELECTEDVALUE ( 'Unit Readiness Table M'[Y_min] ), 'Unit Readiness Table M'[M Gate] = TRIM ( last_gate ) ) VAR y_min_P = IF ( SELECTEDVALUE ( 'All Project v2'[Project Type] ) = "PMP", min_p_calc, min_m_calc ) VAR max_p_calc = CALCULATE ( SELECTEDVALUE ( 'Unit Readiness Table'[Y_max] ),# Y_max is the threshold to be green color 'Unit Readiness Table'[P Gate] = TRIM ( last_gate ) ) VAR max_m_calc = CALCULATE ( SELECTEDVALUE ( 'Unit Readiness Table M'[Y_max] ), 'Unit Readiness Table M'[M Gate] = TRIM ( last_gate ) ) VAR y_max_P = IF ( SELECTEDVALUE ( 'All Project v2'[Project Type] ) = "P", max_p_calc, max_m_calc ) VAR overall_status = SWITCH ( TRUE (), OR ( TRIM ( last_gate ) IN { "Start In", "Start De", "Start Proto", "Insufficient Data", "No Next Gate" }, ISBLANK ( last_Unit_Readiness ) ), BLANK (), last_Unit_Readiness < y_min_P, "FlagLow", last_Unit_Readiness > y_max_P, "FlagHigh", "FlagMedium" ) RETURN overall_statusSolved1.1KViews0likes5CommentsHow to create dax to count total by filtering/excluding a specific value from it
Hi I need to create a card that counts the number of cases by its phase. So for each Case Stream there is a Phase ID value related to the Phase, but one case stream has a different value (inverted meaning) in comparison of other streams, example: Phases Phase ID Case Stream Open 22 Family Open 3 Administrative Open 22 Commercial Open 5 Other In progress 3 Family In progress 22 Administrative In progress 3 Commercial In progress 6 Other As you can see Administrative Case Stream has is special as its value means a different phase, so for example if I need a dax to count total number of cases that are "Open" I would like to exclude Phase ID 22 just for "Administrative" as for this case means In progress (not open). Can someone help me how would be the dax based on this example? Thank you499Views0likes2Comments