I need some help in creating an effective formula to help me return a result into a field if the effective date is within the results column. Also want the formula to be calculated if the discontinue date has not expired.
Here is a snapshot of what I am looking to do.
Project
Where as "T" will only return if effective date is 04/01/2015-04/30/2015 and still within the discontinue date.
(T calculates by looking up a part number volume for that given month)
I hope this is clear.
Thank you.
I believe that this will do what you want:
=IF(AND(A2<=DATEVALUE("4/30/2015"),B2>=DATEVALUE("4/1/2015")),"Your function here","")
You'd get rid of the quotes for "Your function here" and replace it with your delta*vlookup formula.
If you formatted the column heading so it was just the first day of a given month (4/1/2015), you could automate the formula so that you don't have to adjust it for each month column.
Related
I am learning Power BI Desktop. I have a project already loaded for which I have created a
pie chart.
As you can see, the data is currently divided into two years: 2022 and 2021.
I also have data for previous years that I want to include in the chart. Unfortunately, none of these years has a high number. So I want to group them all into an "Other" category.
I've already tried using the RANKX function as described here (where I copied and pasted the formula from the comment and replaced the field name with my own) and here (where I went through the article step by step using my own field names). I used the exact format shown in both the comment and the article:
Rank = RANKX('Table','Table'[Percent],,DESC,Dense)
(Table is the table name I am using and Percent is the column I am trying to rank.)
When I added the new column to a table, though, PowerBI automatically gave me a sum calculation. This calculation gave me a 1 in each column. When I asked it not to give me a sum, it said it could not display the visual and took me back to the calculation screen.
EDIT: Thanks for your help Kevin! This is the table I tried to draw from. I am an idiot sometimes.
EDIT 2: Now I am trying to use a different field in the formula:
Rank = RANKX('FactClaimActivity','FactClaimActivity'[DirectIncurredLoss_ITD])
(This is the original field that I tried to base Percent on)
My table looks like this. (Yes, I know that 2016, 2017, 2019 and 2020 have negative values and 2014 and 2015 have $0 values. I just want to show what the data is.)
EDIT 3: This time I am also getting an error when I type in the formula, which says "A single value for column 'DirectIncurredLoss_ITD' in table 'FactClaimActivity' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
I do not understand why it wants a single result for a formula that ranks the data points based on this field. That seems like it defeats the whole purpose of the formula.
Yet when I use the formula, I get the same result as last time! This column is in the Fixed decimal number format, and it does have many different values.
EDIT: I've found the answer
New Category = IF('FactClaimActivity'[Rank]<=2,'FactClaimActivity'[LossYear],"Other")
The formula will help you get the correct result.
I'm currently working on inventory reconciliation, and I've struggling to fill all days of the calendar with the cumulative sum of product we're currently storing:
Inventory level ($). = CALCULATE(SUM(ledger[cost]),FILTER(ALL(DimDate[Date]),DimDate[Date]<=MAX(ledger[Document Date])))
As you guys might notice it has at least 90% of all dates filled, however if we look closely to the graph, we can appreaciate March 5th of 2016 is missing just due to the fact there was no transaction during that day resulting on a blank value. However I'm trying to accomplish retrieving the previous day balance for those days with no transactions. e.g: for March 5th should have $17,038,462.32 (balance for the previous day March 4th).
I'm trying to work on another clause into the measure with functions such as EARLIER or LASTDATE, however I haven't been succesful.
Any insight or solutions works well thank you. Have a nice day.
You are using a wrong date field in your measure. Change it to the field from the Date table:
Inventory level. =
CALCULATE(
SUM(ledger[cost]),
FILTER(ALL(DimDate[Date]),DimDate[Date]<=MAX(DimDate[Date])))
tried to figure this one myself to no luck and couldn't find similar problem through Google.
I have a number of tables within PowerBI dashboard, one table is a stock table that has values for random dates throughout the month, what i am trying to figure out is, how can i use dates from DayDim table(that has all dates for a month) in a table view and have a measure that would fill in missing dates with the most recent value from the stock table.
Please see a simplified representation as per image attached.
Of course in that stock table i have numerous products and customers etc. for each of those dates, so i would need to have the ability to still calculate values within those contexts, rather than just a total value number.
any help greatly appreciated, thank you in advance.
If you realy need this you can go with an extra column on your Day Dim table (or create a new table).
Value = LOOKUPVALUE(stock[Value];stock[Stock Date];
CALCULATE(MAX('Day Dim Table'[Date]);
FILTER('Day Dim Table';'Day Dim Table'[Date] <=EARLIER('Day Dim Table'[Date]) && RELATED(stock[Value]) <> BLANK())))
Please ensure you create a relation on date between the 2 tables.
I do wonder why you need it because I do not see the point of creating extra data but then again, I do not know your requirements..
I'm new to Power BI so please bear with me, I've searched extensively for a solution but haven't been able to find quite the right thing.
I have a data set that contains (among other things) transactions with amounts and financial periods stored as whole numbers, and what I need to do is use those to arrive at YTD totals. So the user would select a period from 1-12 and then the YTD measure should calculate the totals for the selected period PLUS the previous periods (said another way, it should filter OUT the periods greater than the selected period).
I've tried to filter the totals for the appropriate periods by referencing the selected value of the parameter using "<=" but haven't been able to make that work:
ytd = CALCULATE(SUM(data_tbl[Calculated USD]),data_tbl[PERIOD NUMBER]<=current_period[current_period Value])
I'm probably approaching this the wrong way, but somehow I need to calculate YTD based on the user selecting the desired period. Thanks for any advice.
This is formula that i use
CALCULATE(SUM(Dates[IsWorkDay]),DATESBETWEEN(Dates[Date],
'table1'[date1],'table1'[Date2])))
This is the formula I use... between dates that look like below image.. I want to exclude weekends..... but the result that I get is not correct .... when the actual difference is only one day ... I get it as 4 days ... it differs a lot.. can some one please help
enter image description here
The Data type of all the dates in the formula needs to be in the same format.
For Example: keep it as just date(mm/dd/yy).
Your calculated column is right and it should work once you fix the data types.