"help"
83 TopicsSearch a substring in string from another table with DAX
Hi everyone, I need help figuring out how to search for a substring in another table with DAX. My data looks like this: Table 1: Customer ID Products IDs AA_019442 123456A;123456B BB_149432 123456A CC_924742 123456F;123456C DD_127194 123456C EE_373878 123456E Table 2 (unrelated and unique ids): Product ID Description 123456A AAAAAAAAAAA 123456B BBBBBBBBBBBBB 123456C CCCCCCCCCCCC I need to compare every substring in the column "Product IDs" in Table 1 with the column "Product ID" in Table 2. My expected outcome would be: If both subtrings match, then I should get the description concatenated If just one of the substrings match, then I should get only the description for the ids that math If there is no match, then BLANK Customer ID Product IDs Description AA_019442 123456A;123456B AAAAAAAAAAA;BBBBBBBBBBBBB BB_149432 123456A AAAAAAAAAAA CC_924742 123456F;123456C CCCCCCCCCCCC DD_127194 123456C CCCCCCCCCCCC EE_373878 123456E I know that this could easily be accomplished with PowerQuery/M by splitting every product IDs by the delimiter ";" and matching them, but I'm asking for help with DAX because of how the PowerBI model has been made. I thought at first the SEARCH function or the CONTAINSSTRING one would work, but I didn't manage to write the code for it, because I don't know how to search for contents in another unrelated table. Thanks everyone in advance!!Solved4.3KViews0likes2CommentsRemove blank when Parameter is selected
Hey guys, I need your wisdom with a matrix visualization where I have used a parameter to control the rows, allowing users to select their desired view. My goal is to hide rows that contain "Blank Approver" values when Approver Parameter is selected. Here’s the issue: The "Blank Approver" rows represent rejected items, which should not be displayed if the user selects an "Approved" type. The challenge is that the "Blank Approver" rows should not be shown regardless of the selected type (Approved or Rejected) when the parameter is applied. I have attached an image to illustrate how the matrix should look when both the parameter and type are selected (as an ideal scenario). Is there a way to achieve this behavior where the "Blank Approver" rows are completely hidden when only the parameter is selected? Parameter selected Parameter and Type is selectedSolved592Views0likes2CommentsDetermine if the value displayed is in cents or dollars
hi everyone, is there a trick or tip on how to determine if a value displayed in a graph is in cents or dollars? basically the formula is like this: Formula = VAR work = CALCULATE([Work]) VAR unit = CALCULATE([Unit],'Table1'[Column1]<>"S") RETURN IF(DIVIDE(work,unit)<1,DIVIDE(work,unit)*100,DIVIDE(work,unit))Solved1.1KViews0likes5CommentsHow to filter table with value related to the selectedvalue
I have the two tables below in my power bi file. I have a slicer from Table2 that uses column [Month] as the selected value. If a month is selected, I want to calculate and filter Table1 where Table1 = the associated selected [Date Rank] from Table2 + 1. For example, if 24-Jun is selected from Table2, I want to filter Table1 where [Month] = 24-May. Table1 ID Status Date Rank Previous Status Month Type Group A Normal 3 No previous 24-Mar Task <0 B Normal 3 No previous 24-Mar Task 1 to 5 C Not Normal 3 No previous 24-Mar Task 1 to 5 D Not Normal 3 No Previous 24-Mar Not Task 11 to 15 A Not Normal 2 Normal 24-May Task 6 to 10 B Normal 2 Normal 24-May Not Task 6 to 10 C Normal 2 Not Normal 24-May Not Task 6 to 10 D Not Normal 2 Not Normal 24-May Task 6 to 10 A Not Normal 1 Not Normal 24-Jun Task 1 to 5 B Not Normal 1 Normal 24-Jun Task <0 D Normal 1 Normal 24-Jun Task <0 E Normal 1 24-Jun Task 1 to 5 Table2 Date Rank Month 3 24-Mar 2 24-May 1 24-Jun1.3KViews0likes5CommentsMeasure Does Not work Properly.
Full Name Contract Hours Worked Hours Pay date ABC 76 7.6 15/01/2024 ABC 76 7.6 15/01/2024 ABC 76 14 15/01/2024 JOHN 42 6 28/01/2024 JOHN 42 25 28/01/2024 JOHN 42 3 28/01/2024 Hi Everyone, Above is the sample data of the timesheet. I am getting correct results when i have a single pay date selected but when i add the same measure in matrix and add pay date in the column, i am not getting correct results I am not sure why. 1 st measure to calculate Hours Worked Worked Hours= sum('Table A'[Worked Hours]) 2nd measure to calculate contract hours as Contract hours is done for fortnight Contract Hours = SUMX( SUMMARIZE( 'Table A', 'Table A'[Full Name], "CONTRACT", max('Table A'[Contract Hours]) ), [CONTRACT] ) 3 rd to calculate difference Difference= [Worked Hours]-[Contract Hours] I am checking the variance of the hours so in the matrix i am doing Difference is less than 0 in the filter. Please can someone help me with this Thanks verymuch !!Solved1.7KViews0likes6CommentsWPA Expiry Analysis getting MAX Function Error
For this employee, whose WPA expires on 09-08-2024, I need to search in columns WPA 1, WPA 3, WPA 4 (with a role filter for Floor Leader), WPA 5, WPA 9, WPA 10, WPA 11, WPA 12, WPA 14, and WPA 15 to retrieve the latest date and compare it with the WPA expiry date. If the date is before the WPA expiry date, it's marked as expired. If it's within 30 days of expiry, it's labeled as expiring soon. Only the entries in WPA 4 column corresponding to the Floor Leader role are considered. I'll implement this using DAX Example Data : Employee Role WP1 WP2 WP3 WP4 WP5 WP6 WPAEXPIRY Adam TERMINAL 05-12-23 10-08-23 22-08-23 10-08-23 10-08-23 09-08-24 FLOOR 10-08-23 I Have created dax for VAR LatestExpirationDate = MAXX ( VALUES ( 'All'[Employee Name] ), MAXX ( ROW ( "WPA1 Latest Date", 'All'[WPA1 Latest Date], "WPA2 Latest Date", 'All'[WPA2 Latest Date], "WPA3 Latest Date", 'All'[WPA3 Latest Date], "WPA4 Latest Date", 'All'[WPA4 Latest Date- for Terminal], "WPA5 Latest Date", 'All'[WPA5 Latest Date], "WPA9 Latest Date", 'All'[WPA9 Latest Date], "WPA10 Latest Date", 'All'[WPA10 Latest Date], "WPA11 Latest Date", 'All'[WPA11 Latest Date], "WPA12 Latest Date", 'All'[WPA12 Latest Date], "WPA14 Latest Date", 'All'[WPA14 Latest Date], "WPA15 Latest Date", 'All'[WPA15 Latest Date] ), MAX ( 'All'[WPA1 Latest Date], 'All'[WPA2 Latest Date], 'All'[WPA3 Latest Date], 'All'[WPA4 Latest Date- for Terminal], 'All'[WPA5 Latest Date], 'All'[WPA9 Latest Date], 'All'[WPA10 Latest Date], 'All'[WPA11 Latest Date], 'All'[WPA12 Latest Date], 'All'[WPA14 Latest Date], 'All'[WPA15 Latest Date] ) ) ) RETURN IF ( LatestExpirationDate < MAXX(VALUES('All'[Employee Name]), MAX('All'[WPA EXPIRY])), IF ( DATEDIFF ( LatestExpirationDate, MAXX(VALUES('All'[Employee Name]), MAX('All'[WPA EXPIRY])), DAY ) <= 30, "Expires Soon", "Expired" ), "Not Expired" ) but i am getting Error Too many arguments were passed to the MAX function. The maximum argument count for the function is 2. Looking for support thanks in advance 😊506Views0likes1CommentDynamic Slicers with 2 dates
Hi there esteemed community members. i have a scenario as below below is a sample data, i have share prices for Apple for different dates. i duplicated date column as start date and end date. i want to use these 2 dates as 2 slicers. if user select start date and end date. bottom table should display what is the share price of start date and end date in 2 columns. basically i need 2 measures. i have been trying with calender table and different methods. it only works for start date, as soon as i select start date end date slicer unable to select. any thoughts on this how to achieve ? amitchandak lbendlin mwegener Jihwan_Kim Arul Company Share Price Start Date End Date Date Apple $10. 1/5/2024 1/5/2024 1/5/2024 Apple $15. 5/5/2024 5/5/2024 5/5/2024 Apple $23. 12/5/2024 12/5/2024 12/5/2024 Apple $25. 5/15/2024 5/15/2024 5/15/2024 Apple $32. 5/18/2024 5/18/2024 5/18/2024Solved1.5KViews0likes8CommentsMeasure to sum negative values from another measure not displaying correctly
Hi all, First off, I have created 2 separate measures to SUM positive and negative values. The positive measure appears to be working correctly, but the negative measure is not. I have 5 tables: ProjectTable (Dimension) ProjectEffortTable (Fact) AssignedTable (Fact) Teams (Dimension) Role (Dimension) Specialisation (Dimension) These are my measures: ProjectEffortTotal (Hrs) = SUM('ProjectEffortTable'[Projectefforthours]) AssignedEffortTotal (Hrs) = SUM('AssignedTable'[AssignedEffortHours]) Variance (Hrs) = [ProjectEffortTotal (Hrs)] - [AssignedEffortTotal (Hrs)] Positive Measure = SUMX(filter('ProjectTable', [Variance (Hrs)] > 0), [Variance (Hrs)]) Negative Measure = SUMX(filter('ProjectTable', [Variance (Hrs)] < 0), [Variance (Hrs)]) Matrix Table Hierachry: I have a matrix table which uses 4 fields from 4 different tables and the display hierarchy is: 'ProjectTable'[Project Code], 'Teams'[Team Name], 'Role'[Role Name], 'Specialisation'[Specialisation Name]. The result is below: Any advice on what I am doing wrong and how to fix it would be great? I appreciate it.Solved672Views0likes1CommentHow to tag first occurrence with a filter
Hello, I want to flag the first occurrence of accounts based on a date, with a filter (it should only consider if ACTIVE=yes), and if there are duplicates i need to choose only one of them (randomly/ any of them ). Account CreateDate Active X 15-Mar-24 Yes X 15-Mar-24 Yes Y 14-Mar-24 No Y 15-Mar-24 Yes Expected working is as below Account CreateDate Active FirstOccurrence X 15-Mar-24 Yes 1 X 15-Mar-24 Yes 0 Y 14-Mar-24 No 0 Y 15-Mar-24 Yes 1 I am ok with below solution as well, since I need any of them to be tagged, however I want only one of them to be tagged Account CreateDate Active FirstOccurrence X 15-Mar-24 Yes 0 X 15-Mar-24 Yes 1 Y 14-Mar-24 No 0 Y 15-Mar-24 Yes 1Solved867Views0likes3CommentsPower BI Cross Filter Between Visuals Issue
Hi all - We have report created based on Direct Query using Azure Data Explorer as source. We have column called Duration which is computed in kusto i..e difference between StartTime - Finishtime ( Consider today's time in case of blank). I see the cross filter is not working once the minute passes ( Duration Column includes days hours minutes). Is there workaround to exclude the Duration Column in Cross Filtering. Also, When cross filteting happens, Is there way to force the filter to work on key column instead of all columns i..e Included in below pictue has all the columns. Cross Filter not works after minute passes: Note: DateDiff function is not supported in Direct Query mode for Azure Data Explorer. Data: Model: After Removing Duration Column , Cross Filter works fine Thanks, Abhriam570Views0likes2Comments