Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a Power BI Report that contains many rows and each row has the same 3 address columns, displayed in the order below from left to right.
In each row, one or more of those columns may be populated with data.
Sometimes, the Home Address: Street is populated, but sometimes it's blank and the Mailing Address: Street is populated, in some cases both the Mailing Address: Street and Business Address: Street is populated, and agian sometimes only the Business Address Street is populated.
I have a Dax Measure / Column named DAX Address Street and I need it to use the following logic:
Now, I wrote the following DAX Code, but even though it appears to be syntactically correct, it results in a gray screen with a memory error, even though I have 64 GB RAM on the machine that's running it.
I am just getting into Power BI and DAX so I am certain I did something wrong. Hence, the reason I am here seeking guidance and assistance in determining what I need to do to achieve the objective listed above.
The report columns, DAX Code, and Desired Result I am seeking to achieve are shown in the image below.
RAW DAX Code is here in case it is needed:
DAX Street Address =
IF(
ISBLANK(SELECTEDVALUE('Insured_Member_Dependents'[Home Address: Street])),
IF(
ISBLANK(SELECTEDVALUE('Insured_Member_Dependents'[Mailing Address: Street])),
IF(
ISBLANK(SELECTEDVALUE('Insured_Member_Dependents'[Business Address: Street])),
"Customer Does Not Have Any Address On File",
SELECTEDVALUE('Insured_Member_Dependents'[Business Address: Street]
)),
SELECTEDVALUE('Insured_Member_Dependents'[Mailing Address: Street]
)),
SELECTEDVALUE('Insured_Member_Dependents'[Home Address: Street]
))
How can I achieve the objectve laid out above given the data I provided herein?
Any help, guidance, suggestions, or advise would be greatly appreciated.
Solved! Go to Solution.
I think I solved my own problem. I ended up using power query to get in front of the measure/dax code area, handling it at the pre-data set level as shown below.
Table.AddColumn(#"Filtered Rows1", "PQ Address Street", each if [address2_line1] <> null
then [address2_line1]
else if [address3_line1] <> null
then [address3_line1]
else if [address1_line1] <> null
then [address1_line1]
else "NO CUSTOMER ADDRESS ON FILE")
I think I solved my own problem. I ended up using power query to get in front of the measure/dax code area, handling it at the pre-data set level as shown below.
Table.AddColumn(#"Filtered Rows1", "PQ Address Street", each if [address2_line1] <> null
then [address2_line1]
else if [address3_line1] <> null
then [address3_line1]
else if [address1_line1] <> null
then [address1_line1]
else "NO CUSTOMER ADDRESS ON FILE")
Nice - agree, Power Query is the best place to do this 🙂
Just offering an alternative syntax you may want to consider, using the null-coalescing operator (??):
Table.AddColumn(
#"Filtered Rows1", "PQ Address Street",
each [address2_line1] ?? [address3_line1] ?? [address1_line1] ?? "NO CUSTOMER ADDRESS ON FILE"
)
Regards
User | Count |
---|---|
71 | |
43 | |
21 | |
21 | |
14 |
User | Count |
---|---|
124 | |
42 | |
39 | |
28 | |
24 |