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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous1993
Frequent Visitor

Replace N.a with non null Value corresponding to the same supplier-DAX

Hi,

 

I am having a Dax requirement as shown below.

 

SupplierDateRegion
Amul02-08-2022BE
Amul02-08-2022N.A
LGL02-08-2022DE
LGL02-08-2022DE
Air02-08-2022AN
Amul02-08-2022N.A
Hitachi02-08-2022MN
Amul02-08-2022BE
Telecom02-08-2022N.A
Intel02-08-2022LK
Amul02-08-2022N.A
Intel02-08-2022N.A
Intel02-08-2022N.A
Air02-08-2022AN
Amul02-08-2022N.A
LGL02-08-2022N.A
Air02-08-2022N.A

 

I have few N.A values in Region Columns.i Want to replace these Na with the value in supplier column which has aregion value

 

Example, if Supplier 'Amul' is Shown as BE region, all amul with N.a should be replaced with BE.

 

Each supplier will either have only one region or N.a and some regions will have N.a alone which can be left as such.

Hope this is clear.

 

Thanks in advancefor your help.

1 ACCEPTED SOLUTION

@Anonymous1993 
Please use

Region 1 = 
IF ( 
    Suppliers[Region] = "N.A",
    COALESCE(
        MAXX (
            FILTER ( 
                CALCULATETABLE ( 
                    Suppliers, 
                    ALLEXCEPT ( Suppliers, Suppliers[Supplier] )
                ),
                Suppliers[Region] <> "N.A"
            ),
            Suppliers[Region]
        ),
        "N.A"
    ),
    Suppliers[Region]
)

1.png

View solution in original post

5 REPLIES 5
Anonymous1993
Frequent Visitor

works like a charm! thanks @tamerj1  very much

Anonymous1993
Frequent Visitor

@tamerj1 Could you help on this please

Hi @Anonymous1993 
Please use

Region 1 = 
IF ( 
    Suppliers[Region] = "N.A",
    MAXX (
        FILTER ( 
            CALCULATETABLE ( 
                Suppliers, 
                ALLEXCEPT ( Suppliers, Suppliers[Supplier] )
            ),
            Suppliers[Region] <> "N.A"
        ),
        Suppliers[Region]
    ),
    Suppliers[Region]
)

1.png

Can i know why Telecom is returning blank if no other value is there, it should return N.a itself. could you help on that?

@Anonymous1993 
Please use

Region 1 = 
IF ( 
    Suppliers[Region] = "N.A",
    COALESCE(
        MAXX (
            FILTER ( 
                CALCULATETABLE ( 
                    Suppliers, 
                    ALLEXCEPT ( Suppliers, Suppliers[Supplier] )
                ),
                Suppliers[Region] <> "N.A"
            ),
            Suppliers[Region]
        ),
        "N.A"
    ),
    Suppliers[Region]
)

1.png

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.