conditionals
3 TopicsColumn or measure Conditionals
Hi, I have a column with this conditions: ConditionalColumn= VAR userID= [UserID] VAR IDduplicated = CALCULATE(COUNTROWS(table), ALLEXCEPT(table, table[UserID])) > 1 VAR shopIDduplicated = IF( IDduplicated, CALCULATE( COUNTROWS(table), ALLEXCEPT(table, table[UserID]), table[shopID] = EARLIER(table[shopID]) ) > 1, FALSE() ) RETURN IF( IDduplicated && shopIDduplicated, "Yes", "No" ) I would rather, if UserID is duplicated, for each duplicated UserID, take their shopID. If the shopID is duplicated, put "Yes"; otherwise, put "No". Below, I show you what this conditional column is doing and what i want: Example: I have 3 duplicated UserIDs, but 2 of them have the same shopID. I want the conditional column to show "Yes", only for those 2 lines; for the oder UserID, it becames "No". What's wrong is in lines where UserID is "22" (lines number 2-3-4). It has "Yes" for all 3, but first shopID isn't equal to others, so it should be "No", "Yes", "Yes". Conditional//shopID//categoryID//userID//YearStart;MonthStart;DayStart//YearFinish;MonthFinish;DayFinish Column No 111 1 11 2023 November 10 2023 October 9 Yes 222 2 22 2023 February 28 2023 January 16 Yes 333 3 22 2023 October 6 2023 October 1 Yes 333 3 22 2023 October 16 2023 October 16 No 444 4 33 2023 June 1 2023 May 23 Yes 555 5 44 2023 November 3 Yes 555 5 44 2023 January 19 2023 January 10 Yes 555 6 44 2023 July 28 2023 February 13 Yes 777 5 44 2023 November 2 2023 August 14 Yes 666 9 55 2023 May 31 2023 April 17 Yes 666 9 55 2023 July 21 2023 June 1 PS: The next level would be: once you have those "Yes" values, filter them for the same UserID, shopID, and check if they have the same categoryID. If they do, this would be the real "Yes"; the others would be "No". In that case, taking the table example, for the UserId "44", the correct sequence would be: Yes-Yes-No-No. PS2: The final level would involve, once you have level 2, comparing the start date with the end date for lines that meet the previous criteria. If datediff is <=5 days, it should be "Yes"; otherwise, "No". Next step would be to do the same for the end date, comparing it with other lines' start dates. Before this, thake the next line and do the same... However, it's more important to have levels 1 first and 2 correct, not this level. Any help is appreciated. Thanks!689Views0likes3CommentsReturning value from Table A if Table B condition meet Table A
Hi all, I am new to PowerBI and currently developing some dashboard by facing some issue. I have 2 tables - namely historical_data and current_weekly_data The historical_data consist of 3 columns, Issue Name, Open Date and Status shown below: The current_weekly_data will only consist of 1 column - Issue Name. What I wanted to achieve is to create the Open Date and Status calculated column in current_weekly_data table to achieve the following: I know this can be done using Merge in Power Query but the data is huge and having slowness in performance when doing that and hence I would request for some guidance in doing this using DAX. I have no idea how can I retrieve the value from historical_data table to be inserted into the current_weekly_data table if the issue name match.. any help would be very much appreciated. Thank you!671Views0likes1CommentCondition for month/year not working
Can anyone help with this formula? I created a new column in my calendar table to name the quarter as follows. The first block works well, but when it has to look for the month again, it stops working and leaves everything blank as if there were no more conditions to look for. FiscalQtr = IF(MONTH(Calendario[Date])in{10, 11, 12}, IF(YEAR(Calendario[Date])in{2021},"FY2021Q3", IF(YEAR(Calendario[Date])in{2022},"FY2122Q3", IF(YEAR(Calendario[Date])in{2023},"FY2223Q3", IF(YEAR(Calendario[Date])in{2024},"FY2324Q3", IF(MONTH(Calendario[Date])in{1, 2, 3}, IF(YEAR(Calendario[Date])in{2021},"FY2021Q4", IF(YEAR(Calendario[Date])in{2022},"FY2122Q4", IF(YEAR(Calendario[Date])in{2023},"FY2223Q4", IF(YEAR(Calendario[Date])in{2024},"FY2324Q4", IF(MONTH(Calendario[Date])in{4, 5, 6}, IF(YEAR(Calendario[Date])in{2021},"FY2021Q1", IF(YEAR(Calendario[Date])in{2022},"FY2122Q1", IF(YEAR(Calendario[Date])in{2023},"FY2223Q1", IF(YEAR(Calendario[Date])in{2024},"FY2324Q1", IF(MONTH(Calendario[Date])in{7, 8, 9}, IF(YEAR(Calendario[Date])in{2021},"FY2021Q2", IF(YEAR(Calendario[Date])in{2022},"FY2122Q2", IF(YEAR(Calendario[Date])in{2023},"FY2223Q2", IF(YEAR(Calendario[Date])in{2024},"FY2324Q2"))))))))))))))))))))Solved712Views0likes3Comments