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 table that should provide a row per calendar day and is refreshed several times a day. The data is the current stock level of a warehouse. Based on the data, two measures make a simple 7-day simulation of expected warehouse space. The calculation is cumulative and quite straightforward and the main measure is below.
Occasionally there isn't a row for "NetOfDeliveryCollection" on a calendar day so the simulation goes awry. I think I just need to add a value of zero for that missing day but my quesiton is how? Should I create a fake row in the dataload script or just add an IF condition in the DAX.
Either method, I don't know how to do this!
Measure = SUM(DailyBalances[CurrBalance])
+ CALCULATE(
SUM(Delivery[NetOfDeliveryCollection])
, FILTER(
ALLSELECTED(Delivery)
,Delivery[DelDate] <= MAX(Delivery[DelDate])
)
)
Solved! Go to Solution.
Hi, @PauSe
You can add IF conditions to the DAX. This is shown below.
Measure =
VAR N1 =
SUM ( DailyBalances[CurrBalance] )
+ CALCULATE (
SUM ( Delivery[NetOfDeliveryCollection] ),
FILTER (
ALLSELECTED ( Delivery ),
Delivery[DelDate] <= MAX ( Delivery[DelDate] )
)
)
VAR N2 =
SUM ( DailyBalances[CurrBalance] ) + 0
RETURN
IF ( SELECTEDVALUE ( Delivery[NetOfDeliveryCollection] ) = BLANK (), N2, N1 )
Please try this formula, does this match your desired result?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @PauSe
You can add IF conditions to the DAX. This is shown below.
Measure =
VAR N1 =
SUM ( DailyBalances[CurrBalance] )
+ CALCULATE (
SUM ( Delivery[NetOfDeliveryCollection] ),
FILTER (
ALLSELECTED ( Delivery ),
Delivery[DelDate] <= MAX ( Delivery[DelDate] )
)
)
VAR N2 =
SUM ( DailyBalances[CurrBalance] ) + 0
RETURN
IF ( SELECTEDVALUE ( Delivery[NetOfDeliveryCollection] ) = BLANK (), N2, N1 )
Please try this formula, does this match your desired result?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, this answered my question of how to add an IF into a DAX. For the record, your formula didnt solve my problem but you have answered my question.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
84 | |
65 | |
62 | |
55 |
User | Count |
---|---|
179 | |
108 | |
104 | |
71 | |
70 |