Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am facing an issue while trying to calculate the total number of parts which will fall short within next 15 days.
I have created a new date column as:
15 days =
var x = today()+15
var y = if('Calendar'[new_date]<=x,'Calendar'[new_date],BLANK())
return y
I have created this measure as:
ShortageCount_15 =
var itemName = FIRSTNONBLANK(Shortages[name],Shortages[name])
var x = if('Shortages'[Total]<0,CALCULATE(SELECTEDVALUE('Calendar'[new_date]),FILTER('Calendar','Calendar'[Date]<=max('Calendar'[15 days]))))
var y = DATEDIFF(TODAY(),x,DAY)
RETURN
CALCULATE(
count(Shortages[item_segments]),
filter(Shortages,y <=15 &&
Shortages[name] = itemName
))
I earlier worked upon creating the measure for calculating the parts that will fall short as of today:
ShortageCount =
var itemName = FIRSTNONBLANK(Shortages[name],Shortages[name])
RETURN
CALCULATE(
count(Shortages[item_segments]),
filter(Shortages,Shortages[Shortage day] = -1 &&
Shortages[name] = itemName
))
Can someone please help me with it?
HI @sajal161292,
Does 'Shortage day' means a measure with variable calculate formulas? If this is a case, I'd like to suggest you to take a look at following links:
Optimizing DAX expressions involving multiple measures
Order of Evaluation in CALCULATE Parameters
AFAIK, if you nested use multiple measure for variable formulas who has particulate filters, it may not works properly at all row contents level.(for total row level, it may calculate with different result than you wanted)
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |