Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Show Earliest Date That Meets Conditions

Hello PBI Community,

I've been trying to solve an issue where I have a true/false measure that will indicate when a team will reach a certain benchmark.

In this first image, you can see the Forecast date, Optimistic date, and Pessimistic date cards on the top right which correlate to the table Estimated Points value and when a team reaches that point. If the two concerned columns match, we get a 1 to show up. Now the multi-row cards on top have been filtered to show only the dates that meet this condition. The issue is that it doesn't show just the first day the condition is met. We would rather not have it scroll. 

DAXtheDestroyer_0-1662750068650.png

Expanding the card for clarity.

DAXtheDestroyer_1-1662750087791.png

If I make the visual a single value card showing the earliest date, the card is populated with the first date in the table, rather than the first to meet the condition.

DAXtheDestroyer_2-1662750155685.png

Even when filtered for only the dates that meet the condition.

DAXtheDestroyer_3-1662750179029.png

I've made a few posts about this issue, and this is hopefully much clearer than I have explained previously.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Solved it!

this is the DAX needed to find my first non-blank date for each column.

 
ForecastDate = CALCULATETABLE(
    FIRSTNONBLANK(Dates[Date], [IsMetForecastIndicator]))
 

First I had to change the original DAX to produce a blank for false and this worked perfectly.

Proof:

DAXtheDestroyer_1-1663009264974.png

 

View solution in original post

3 REPLIES 3
m_alireza
Solution Specialist
Solution Specialist

Hi @DAXtheDestroyer ,
Create 3 measures with the code below, changing the reference for IsMetForecastIndicator, ISMetOpFore, and IsMetPESFore respectively. 
Example measure for IsMetForecastIndicator. 

 

 

IsMetForecastIndicatorCard = CALCULATE(min('Table'[Date]),'Table'[IsMetForecastIndicator]=1)

 

 

 This should take the earliest date that has an "IsMetForecastIndicator" value of 1. 

Once you created the 3 measures, convert them into single value cards. 

Screenshot of Output:

sampledate.png

 



 

Thank you for helping me out. Unfortunately, that produced an "A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter" error. I was able to get around it by changing the DAX a bit:

DAXtheDestroyer_0-1663001017054.png

But I still get the wrong date to populate. It is reverting to the earliest date in the date filter in the upper left corner:

DAXtheDestroyer_1-1663001083016.png

 

Solved it!

this is the DAX needed to find my first non-blank date for each column.

 
ForecastDate = CALCULATETABLE(
    FIRSTNONBLANK(Dates[Date], [IsMetForecastIndicator]))
 

First I had to change the original DAX to produce a blank for false and this worked perfectly.

Proof:

DAXtheDestroyer_1-1663009264974.png

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.