Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
New to DAX and its language.
I am trying to make a measure that gives feedback if a date from one column is greater than a date in another column. This is for multiple projects that are using the same base template with different dates for each. So duplicate columns are expected.
I tried this formula:
IsNetworkReadyOnTrackforUAT = IF(LOOKUPVALUE(Tasks[TaskFinishDate],Tasks[ShortTaskName],"NETWORK READY") > LOOKUPVALUE(Tasks[TaskFinishDate],Tasks[ShortTaskName],"UAT"), "IN TROUBLE","ALL GOOD")
this produces an error of multiple values. In researching, I tried using calculate with FIRSTNONBLANK like this:
IsNetworkReadyOnTrackforUAT = IF(
CALCULATE(
FIRSTNONBLANK(Tasks[TaskFinishDate], 1),
FILTER(ALL(Tasks),Tasks[ShortTaskName] = "UAT")
)
>
CALCULATE(
FIRSTNONBLANK(Tasks[TaskFinishDate], 1),
FILTER(ALL(Tasks),Tasks[ShortTaskName] = "NETWORK READY")
),
"IN TROUBLE",
"ALL GOOD")
This returns the same value for all of the rows (each row has a different value). Here is a snapshot of the data.
I think I'm missing something basic but unsure.
your sample data doesn't match your description. It is unclear if you are trying to look up something in the same table or another table (LOOKUPVALUE is usually used for the latter). Please elaborate.
No, all the data is contained within the same table.
Here is a summary of what I'm looking to do:
For each PROJECT NAME, find the TASK NAME called "UAT" and select the START date. For each PROJECT NAME, find the TASK NAME called "NETWORK READY" and select the START date. Comp[are these two START dates. If the START date for UAT is greater than the START date for "NETWORK READY", output "GOOD". Else, output "BAD".
I've highlighted two example columns out of my data.
The output here in this case should be GOOD.
TIA
@tlh , below is formula, i added a condition: if we are missing data for either uat or network days return "no compare".
Result =
VAR _UatStart =
LOOKUPVALUE (
Tasks[Start],
Tasks[Task Name], "UAT",
Tasks[Project Name], Tasks[Project Name]
)
VAR _NetworkStart =
LOOKUPVALUE (
Tasks[Start],
Tasks[Task Name], "NETWORK READY",
Tasks[Project Name], Tasks[Project Name]
)
RETURN
IF (
Tasks[Task Name] IN { "UAT", "NETWORK READY" },
IF (
AND ( NOT ( ISBLANK ( _NetworkStart ) ), NOT ( ISBLANK ( _UatStart ) ) ),
IF ( _NetworkStart > _UatStart, "IN TROUBLE", "ALL GOOD" ),
"NO COMPARE"
)
)
What is your plan for scenarios when either of the entries is missing or duplicated?
Thanks for your help, but still not working. Here is what I'm doing. I duplicated the data into a table called TestTable and updated your formula.
No plans for that yet. It should never happen as they are a part of the template used.
@tlh there are fields underlined with red line, it means that there is no such field in your table/model. Check these and make sure you type it correctly.
Another thing, if there are no underlined fields and you get error that it cant get single value (as on screenshot) it means that there is still column in table which we need to add in lookup as on current lookup parameters dax cant find unique value.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
20 | |
14 | |
10 | |
9 | |
6 |