Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello everyone,
Could you please help me with the following?
The following table has an ID and finish date when one ID wasn't finish the closed date is blank. Now I want to count the lines that are in blank in the previous days according to the finish date like the example on the table:
Hi,
Write this calculated column formula
Column = COALESCE(CALCULATE(COUNTBLANK(Data[Closed Date]),FILTER(Data,Data[Finish Date]<EARLIER(Data[Finish Date]))),0)
Hope this helps.
Certainly! Let’s break down the task step by step:
Understanding the Problem:
Approach:
Solution:
DAX Formula:
Accumulated = VAR CurrentFinishDate = MyTable[Finish Date] RETURN CALCULATE( COUNTROWS(MyTable), FILTER( MyTable, MyTable[Finish Date] = CurrentFinishDate && ISBLANK(MyTable[Closed Date]) ) )
Explanation:
Result:
Here’s how the first few rows of your updated table might look:
ID Finish Date Closed Date Accumulated1 | 11/23/2023 | 11/23/2023 | 0 |
2 | 11/23/2023 | Blank | 0 |
3 | 11/23/2023 | 11/23/2023 | 0 |
4 | 11/24/2023 | 11/24/2023 | 1 |
… | … | … | … |
Remember to adjust the table and column names according to your actual data. If you encounter any issues or need further assistance, feel free to ask! 😊
Hello, thank you for the help.
I put the formula and it calculates the blank lines but for the same date, not the blank lines for previous dates. Could you help me again?
The line inside FILTER that compares
MyTable[Finish Date] = CurrentFinishDate
should be
MyTable[Finish Date] <= CurrentFinishDate
or
MyTable[Finish Date] < CurrentFinishDate
Let me know how this goes.
User | Count |
---|---|
85 | |
82 | |
66 | |
52 | |
48 |
User | Count |
---|---|
100 | |
49 | |
42 | |
39 | |
38 |