The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello! I've been spending multiple hours over the last several days trying to get this formula to work. I have two date columns, from two different tables, the tables have a relationship.
I need to have dax look for a blank value from the 1st table column 'STEP Projects' [PM/AppTransitionMtg] to then replace the date value in the 2nd table column 'STEP Resource Planning' [Start] to blank . If no blank is found from the 1st table, then 2nd table column 'STEP Resource Planning' [Start] remains with its original value.
Here are some formulas that I tried, nothing worked.
StartISBlank = SWITCH(LOOKUPVALUE('STEP Projects'[PM/AppTransitionMtg],[PM/AppTransitionMtg],"",'STEP Resource Planning'[Start],""))
StartISBlank = IF(isblank('STEP Resource Planning'[Start]),LOOKUPVALUE('STEP Projects'[PM/AppTransitionMtg],'STEP Projects'[PM/AppTransitionMtg],'STEP Resource Planning'[Start],'STEP Projects'[PM/AppTransitionMtg]))
StartISBlank = MAXX(FILTER('STEP Projects','STEP Projects'[PM/AppTransitionMtg]='STEP Resource Planning'[Start]),'STEP Projects'[PM/AppTransitionMtg])
Solved! Go to Solution.
Hello @Sunnie ,
From your explanation I see 2 approaches here.
1) If you just want to have a column showing either blank value or value from 'STEP Resource Planning' [Start], then you can creare a calculated column , for example, in 'STEP Projects' table. The code can be like this:
New Start = IF(ISBLANK('STEP Projects'[PM/AppTransitionMtg]), BLANK(), RELATED('STEP Resource Planning'[Start]))
2) If you want to change an existing [Start] column values of 'STEP Resource Planning' table then you need to use Power Query, not DAX. In this case you might need a custom lookup function as described here:
Replicate doing an Excel VLOOKUP in M
with final code as a step like this
#"Replaced Value" =
Table.ReplaceValue(#"Previous step name",
each [Start],
each if fxLookup([Id], #"STEP Projects", "Id", "PM/AppTransitionMtg") = null then null else [Start],
Replacer.ReplaceValue,{"Start"})
* [Id] here is a common column (used also to build relations).
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hello @Sunnie ,
From your explanation I see 2 approaches here.
1) If you just want to have a column showing either blank value or value from 'STEP Resource Planning' [Start], then you can creare a calculated column , for example, in 'STEP Projects' table. The code can be like this:
New Start = IF(ISBLANK('STEP Projects'[PM/AppTransitionMtg]), BLANK(), RELATED('STEP Resource Planning'[Start]))
2) If you want to change an existing [Start] column values of 'STEP Resource Planning' table then you need to use Power Query, not DAX. In this case you might need a custom lookup function as described here:
Replicate doing an Excel VLOOKUP in M
with final code as a step like this
#"Replaced Value" =
Table.ReplaceValue(#"Previous step name",
each [Start],
each if fxLookup([Id], #"STEP Projects", "Id", "PM/AppTransitionMtg") = null then null else [Start],
Replacer.ReplaceValue,{"Start"})
* [Id] here is a common column (used also to build relations).
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Much appreciated. I tried your formulas, and both worked. Your 2nd formula is what I needed , and received the below formula last week.
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |