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 guys
i am new to power bi i need to calculate the stock of the last day dynamically. For example i having stocks from january 2018 to November 2019. I want to calculate the last day stock value say last day of November 2019 and if i select September in the filter it must show the last day stock value for september. Please provide me a solution.
Solved! Go to Solution.
Hi,
You may download my solution PBI file from here.
Hope this helps.
Hi,
You may download my solution PBI file from here.
Hope this helps.
Hi @Anonymous ,
Here I have created a sample for your reference. We can use a measure as below to work it out.
Measure =
VAR LASTDAY =
CALCULATE ( MAX ( 'Table'[date] ), ALLSELECTED ( 'Table' ) )
RETURN
CALCULATE (
SUM ( 'Table'[value] ),
FILTER ( 'Table', 'Table'[date] = LASTDAY )
)
For more details, please check the pbix as attached.
Try
Last Day of month Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(sales,Sales[Sales Date]=ENDOFMONTH('Date'[date])))
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Second, MAX and MAXX are your friends in this case. So, if you select a month in some sort of Month slicer then I assume that all of the days for September will be in context so you could do something like:
Measure =
VAR __maxDate = MAXX('Some Table',[Date])
RETURN
MAXX(FILTER('Some Table',[Date] = __maxDate),[Value])
This is all purely conjecture because I don't have any example source data.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |