The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I need to calculate how many days gap each stock has until I see the first value, but I couldn't find a solution.
It has to take into account up to the first value it encounters.
Can you help me?
Thank you for your support.
To calculate the number of days until the first value for each stock, you can use a combination of DAX functions such as FILTER, MINX, and DATEDIFF. Try this:
Days Until First Value =
VAR FirstValueDate = MINX(FILTER(StockData, [Value] <> BLANK()), [Date])
RETURN IF(ISBLANK(FirstValueDate), BLANK(), DATEDIFF(StockData[Date], FirstValueDate, DAY))
Unfortunately it doesn't work.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
80 | |
74 | |
52 | |
50 |
User | Count |
---|---|
132 | |
124 | |
78 | |
64 | |
61 |