Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 Number | Shipment Quantity | Shipment Value | Ship Date | Shipped During Month End |
Sales001 | 1 | 100 | 2025/6/30 | Yes |
Sales001 | 1 | 100 | 2025/6/30 | Yes |
Sales001 | 2 | 100 | 2025/6/15 | NO |
Sales002 | 3 | 100 | 2025/6/15 | NO |
Sales003 | 4 | 100 | 2025/6/15 | NO |
Table2 contains invoicing info.
Order Number | Shipment Quantity | Invoiced Value |
Sales001 | 1 | 100 |
Sales001 | 1 | 120 |
Sales001 | 2 | 100 |
Sales002 | 3 | 100 |
Sales003 | 4 | 100 |
I also have a lookup table with unique Order Number, used in a visual with the following measures:
SUM(Invoiced Value) from Table2
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?
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 Number | Sum(invoiced value) | Sum(Shipment Vallue) | ShippedMonthEndFlag |
Sales001 | 100 | 100 | Yes |
Sales001 | 120 | 100 | |
Sales001 | 100 | 100 | NO |
Sales002 | 100 | 100 | NO |
Sales003 | 100 | 100 | NO |
Sales004 | 100 | 100 | NO |
Sales005 | 100 | 100 | NO |
Sales006 | 100 | 100 | NO |
Sales007 | 100 | 100 | NO |
Sales008 | 100 | 100 | NO |
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)?
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
is this OK?
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
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |