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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jack007
Frequent Visitor

Why does my DAX measure using first no blan return blank even though the column has no blank values?

I have two fact tables:

  • Table1 contains shipment info (Order Number, Shipment Value, Ship Date, and a "Shipped During Month End" column with "Yes"/"NO" values). 

    Order NumberShipment QuantityShipment ValueShip DateShipped During Month End
    Sales00111002025/6/30Yes
    Sales00111002025/6/30Yes
    Sales00121002025/6/15NO
    Sales00231002025/6/15NO
    Sales00341002025/6/15NO
  • Table2 contains invoicing info.

    Order NumberShipment QuantityInvoiced Value
    Sales0011100
    Sales0011120
    Sales0012100
    Sales0023100
    Sales0034100

    I also have a lookup table with unique Order Number, used in a visual with the following measures:

    1. SUM(Invoiced Value) from Table2

    2. SUM(Shipment Value) from Table1ShippedMonthEndFlag :=
      CALCULATE(
      FIRSTNONBLANK('Table1'[Shipped During Month End], 1),
      ALLEXCEPT('LookupTable', 'LookupTable'[Order Number])
      )

      When I add these to a matrix visual (Order Number on rows), the third measure returns blank for most orders, even though Shipped During Month End has no blank values.

      Why is this happening?

5 REPLIES 5
FBergamaschi
Solution Specialist
Solution Specialist

A couple of questions

 

1 - Can you please show the bad result you are getting ? I am unable to reproduce the issue, maybe you should insert more rows in the tables you shared?

 

2 - why are you using 1 as expression in FIRSTNONBLANK? I mean what are you trying to calculate with the measure ShippedMonthEndFlag?

 

Best

FB

 

If this helped, please consider giving kudos and mark as a solution

@mein replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

1.

Order NumberSum(invoiced value)Sum(Shipment Vallue)ShippedMonthEndFlag 
Sales001100100Yes
Sales001120100 
Sales001100100NO
Sales002100100NO
Sales003100100NO
Sales004100100NO
Sales005100100NO
Sales006100100NO
Sales007100100NO
Sales008100100NO

2.I want to know if the the order has made shipment during the end of the month. 

1. I cannot replicate your issue so I cannot fix it

 

2.

What about grouping the column Shipped During Month End (putting it in rows of the matrix)?

FBergamaschi_1-1753032242356.png

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

 

2. SUM(Shipment Value) from Table1

3. ShippedMonthEndFlag :=
CALCULATE(
FIRSTNONBLANK('Table1'[Shipped During Month End], 1),
ALLEXCEPT('LookupTable', 'LookupTable'[Order Number])
) when the visual only has these 2 measurs, it works as intended. when i  add this measure 

1. SUM(Invoiced Value) from Table2 . th eproblem starts to occur.

I got this result, grouping order numbers, keeping the two measures that SUM Invoice and Ship value and creating this measure

 

ShippedMonthEndFlag =
VAR NumberShipEOM =
    SUMX (
        VALUES ( Orders[Order Number] ),
        IF (
            CALCULATE ( COUNTROWS ( Ship ), Ship[Shipped During Month End] = "Yes" ) > 0,
            1
        )
    )
RETURN
    IF (
        [Ship Value] <> 0
            && ISINSCOPE ( Orders[Order Number] ),
        IF ( NumberShipEOM > 0, "Yes", "No" )
    )

 

is this OK?

 

FBergamaschi_0-1753079461313.png

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.