Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone
I have created a measure called "CostFlag" which flags the rows where the "Output" is greater than the "TotalAvg". My queries are:
- How to flag continuous 8 rows where the CostFlag is 1
- Find min date of the CostFlag - marked in blue in the image below
Please find the screenshot below for your reference.
Thanks
Kay
Solved! Go to Solution.
Hi @kay87
Please give this a shot
Measure = VAR mytable1 = FILTER ( VALUES ( Table1[Date] ), [CostFlag] = BLANK() ) VAR mytable2 = ADDCOLUMNS ( mytable1, "Date Diff", DATEDIFF ( [Date], MINX ( FILTER ( mytable1, [Date] > EARLIER ( Table1[Date] ) ), [Date] ), DAY ) - 1 ) RETURN MINX ( FILTER ( mytable2, [Date Diff] >= 8 ), [Date] ) + 1
Thank you for the link. As I understand this is to add a new column to the data table but I am looking to create a measure to do the above.
Please correct me if I am wrong as I just stared with Power BI and making a transtion from being an advanced user in Qlik to PBI. This could easily be achieved in Qlik by using rangemax function in the straight table.
Regards
Kay
Hi @kay87
Please give this a shot
Measure = VAR mytable1 = FILTER ( VALUES ( Table1[Date] ), [CostFlag] = BLANK() ) VAR mytable2 = ADDCOLUMNS ( mytable1, "Date Diff", DATEDIFF ( [Date], MINX ( FILTER ( mytable1, [Date] > EARLIER ( Table1[Date] ) ), [Date] ), DAY ) - 1 ) RETURN MINX ( FILTER ( mytable2, [Date Diff] >= 8 ), [Date] ) + 1
Help! I'm getting the following error when I create the measure "Column 'CostFlag' cannot be found or may not be used in this expression."
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
104 | |
77 | |
71 | |
50 |
User | Count |
---|---|
145 | |
108 | |
107 | |
90 | |
65 |