Forum Discussion
IFERROR
Hi All,
I am trying to use the IFERROR in DAX.
This is the formula I have used for Recommended Daily Usage Type.
I do not understand why I have blank spaces. Is it not supposed to be the same as Daily Usage Type?
If the usage of the formula is incorrect, how can I get the same values as Daily usage type in the blank spaces of Recommended Daily Usage Type?
Any help would be appreciated!
Thank you!
Hey Anonymous ,
then that's not an error. You can check if it's blank to return the Usage Type and otherwise the lookup value.
Try the following measure:
Recommended Daily Usage Type = VAR vLookupValue = LOOKUPVALUE( 'Daily Usage Type'[Proposed Daily Usage], 'Daily Usage Type'[PartPlantbyYearWeekNum], 'Master Data Hygiene (2)'[PartPlantbyYearWeekNum] ) RETURN IF( vLookupValue = BLANK(), 'Master Data Hygiene (2)'[Daily Usage Type], vLookupValue )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
6 Replies
- selimovdMost Valuable Professional
Hey Anonymous ,
your formula is doing the following:
You are searching for the value of 'Master Data Hygiene (2)'[PartPlantbyYearWeekNum] in the column 'Daily Usage Type'[PartPlantbyYearWeekNum] and then return from the same row the value from 'Daily Usage Type'[Proposed Daily Usage].
If there is no match you return the value of 'Master Data Hygiene (2)'[Daily Usage Type].
I guess the value of Daily Usage Type'[Proposed Daily Usage] or 'Master Data Hygiene (2)'[Daily Usage Type] are blank. Maybe you can take a specific row and really check in detail what the function is doing.
If you share the file, I can also try to help you with that.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic- AnonymousNot applicable
Hi selimovd ,
Thank you!
Yes. For some PartPlantbyYearWeekNum, the Proposed Daily usage type is blank. i.e., Daily Usage Type'[Proposed Daily Usage] is blank.
And hence, for the blank rows, I want the same values to be copied in Daily Usage type.
For eg: In the image above, In 3rd row, Recommended Daily usage is blank. So, I want it be ADU. Same as that of Daily Usage type.
- selimovdMost Valuable Professional
Hey Anonymous ,
then that's not an error. You can check if it's blank to return the Usage Type and otherwise the lookup value.
Try the following measure:
Recommended Daily Usage Type = VAR vLookupValue = LOOKUPVALUE( 'Daily Usage Type'[Proposed Daily Usage], 'Daily Usage Type'[PartPlantbyYearWeekNum], 'Master Data Hygiene (2)'[PartPlantbyYearWeekNum] ) RETURN IF( vLookupValue = BLANK(), 'Master Data Hygiene (2)'[Daily Usage Type], vLookupValue )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
- ChrisMendozaResident Rockstar
Possibly you're not getting an error because an 'error' is not occurring in the LOOKUP
If there's no match that satisfies all the search values, BLANK or alternateResult (if supplied) is returned. In other words, the function won't return a lookup value if only some of the criteria match.
https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax#return-value
Maybe try putting something in the optional <alternateResult>