dynamic flag
5 TopicsDynamic measure flag not working on every row
I'm attempting to use DAX code that will flag survey years within a window of time. The window is equal to a selected year and 2 years before. The selected year will change based on the ID that is selected so I'm trying to use a measure over a column. My current DAX attempt is: Window Flag = VAR SurvYear = selectedvalue('My Hospital Summary'[Survey Year]) VAR flag = calculate( countrows('Def Peer Group Summary'),filter('Def Peer Group Summary', 'Def Peer Group Summary'[Survey Year] <= SurvYear && 'Def Peer Group Summary'[Survey Year] >= SurvYear-2)) Return flag My current result is: It's almost doing exactly what I need but for some reason it is not counting the rows of all the IDs. Ideally in the above screenshot there should be a 1 next to every year that is 2021-2023. Any help would be great appreciated!Solved972Views0likes3Commentscompare data sets based on dates
Hello All, I am new to power bi and I have to build few metrics based on below sample data set. I have two give two date filters baseline and comparison and have to display a flag or highlight of the value for the column like status or Priority is changed between those dates. Suppose I select 30 Oct in base line slicer and 23 Oct in Comparison slicer a) I have to create vizulization to highlight/flag the columns that have changed. b) Count of newly added records also details c) count of deleted records and details d) count of changed records ( one of the column value is changed) and details Please help and suggest better implementation for above scenarios. runid Id Status Priority 30102023 ENG-666 Monitoring P1 30102023 ENG-111 Monitoring P1 30102023 ENG-122 Monitoring P3 30102023 ENG-333 Monitoring P3 30102023 ENG-555 Teminated P4 25102023 ENG-555 Teminated P4 25102023 ENG-111 Monitoring P1 25102023 ENG-122 Monitoring P2 25102023 ENG-333 Monitoring P3 25102023 ENG-666 Monitoring P4 20102023 ENG-111 Monitoring P1 20102023 ENG-122 Monitoring P2 20102023 ENG-333 Monitoring P3 20102023 ENG-555 Teminated P4 20102023 ENG-666 Monitoring P4 15102023 ENG-111 Monitoring P1 15102023 ENG-122 Monitoring P2 15102023 ENG-333 Monitoring P3 15102023 ENG-444 Monitoring P4 15102023 ENG-555 Monitoring P4Solved830Views0likes2CommentsDynamic Flag Column That Changes Rows Depending On Today's Date
Hi PowerBi Experts, I am facing an issue where I need to display a table of data depending on which day of the week it is. My dataset sample is as below - Project Name | Transaction Month | Reporting Date | Transaction Week Start | Transaction Week End | Weekly Sales Row 1 Project A | August 2023 | 7 August 2023 | 31 July 2023 | 6 August 2023 | 20 Row 2 Project B | August 2023 | 7 August 2023 | 31 July 2023 | 6 August 2023 | 3 Row 3 Project C | August 2023 | 7 August 2023 | 31 July 2023 | 6 August 2023 | 12 Row 4 Project A | August 2023 | 14 August 2023| 7 August 2023 | 13 August 2023 | 14 Row 5 Project B | August 2023 | 14 August 2023| 7 August 2023 | 13 August 2023 | 5 Row 6 Project C | August 2023 | 14 August 2023| 7 August 2023 | 13 August 2023 | 7 Row 7 Project A | August 2023 | 21 August 2023| 14 August 2023 | 20 August 2023 | 9 Row 8 Project B | August 2023 | 21 August 2023| 14 August 2023 | 20 August 2023 | 0 Row 9 Project C | August 2023 | 21 August 2023| 14 August 2023 | 20 August 2023 | 3 Now, the requirement is that if the user views the report on 14th August 2023 (Monday), the table should only show Rows 1 to 3, to show data within the Transaction Week range. This applies to all subsequent Mondays. From 15th August 2023 (Tuesday) to 20th August (Sunday), the user should only be able to view Rows 4 to 6. This is how the flag should work. What I've tried - I came up with this DAX formula, but it does not work as intended. It should only apply the flag to Rows 4-6, based on today's date (10 Aug), but it applies the flag to Rows 1-3 as well. VAR TodayDate = TODAY() VAR MondayTwoWeeksAgo = TodayDate - WEEKDAY(TodayDate, 2) - 13 VAR MondayOneWeekAgo = TodayDate - WEEKDAY(TodayDate, 2) - 6 RETURN IF( [Transaction Week Start] >= MondayTwoWeeksAgo && [Transaction Week Start] <= MondayOneWeekAgo, "Flag", BLANK() ) I am at a lost, and have been cracking my head for hours now, how can I achieve the aboe - any help will be greatly appreciated! Thanks & Best Regards, LeeWJ681Views0likes2CommentsHelp Flag on column
I am trying to create 2 measures one for flag a and another for flag b, and these measures have to change based on the date range filtered and the appearance of all two flags in the recent date. So in other words if I apply a filter from 25/02/2023 to 08/03/2023 as in the picture the output of the measure flag A must be 0 in all rows because in the last date 08/03/2023 it does not appear, it appears flag so in the measure flag B must be 1 in all rows because in 08/03/2023 it appears as in the picture. Result expected: I can get the flag to change dynamically but only on the last row not all rows of all two measures, I don't know if it is possible to do that with a measure. Thanks.836Views0likes1CommentCreate a Dynamic Flag based off a Date Range Slicer
Hello; I have a data set of projects that have both a start and a finish date, for example: Project Number Project Name Start Date Finish Date 1 Abc 1/15/2020 4/21/2020 2 Def 3/18/2020 8/10/2020 3 Ghi 4/12/2020 9/5/2020 4 JKL 9/19/2020 3/1/2021 My users want a dashboard that has a date slicer providing a range, so for instance 5/1/2020 - 8/30/2020, and then only display the projects that are active betwen that range. I was thinking I could provide a flag, so in the case of the above data it would look like this given the above dates: Project Number Project Name Start Date Finish Date Flag 1 Abc 1/15/2020 4/21/2020 0 2 Def 3/18/2020 8/10/2020 1 3 Ghi 4/12/2020 9/5/2020 1 4 JKL 9/19/2020 3/1/2021 0 Based on what I have seen from other posts, I think something like this can be done via DAX, but I don't have enough experience with the language yet to be able to program it. For Refence my Table is named "Projects" and the slicer is "Active Date Range". Any help you guys can give would be appreciated. Thanks Gerry2KViews0likes3Comments