Lookup last value in sheet where other cell contains value - regex

I'm trying to find the last instance of a value in a sheet. The value is an amount of currency, and the condition should be if the type of currency is Income. For example, I have a sheet with
Date Name Amount Type
2019-08-01 Cash on hand 52.52 Income - Allowance
2019-08-02 Cash on hand 33.33 Income - Hourly
and I want to match the latest amount of income (33.33) and display it in another cell.
I've tried something like =INDEX(FILTER(A:A;NOT(ISBLANK(A:A)));ROWS(FILTER(A:A;NOT(ISBLANK(A:A)))) from Get the last non-empty cell in a column in Google Sheets where instead of NOT(ISBLANK()) I tried to put "Income*. I also tried to do a chain of MAX(FILTER()), but I got an error:
FILTER has mismatched range sizes. Expected row count: 999. column count: 1. Actual row count: 1, column count: 1.
Any help would be much appreciated.

=QUERY(A2:D, "select C where D matches 'Incom.*' offset "&COUNTA(
QUERY(A2:D, "select C where D matches 'Incom.*'", 0))-1, 0)

Related

I am tracking my investments - If column 2 (contains my contribution) is less than column 3 (investment return), return column 1 (date of occurrence)

I have a spreadsheet on Google Sheets that tracks my investment. Based on average returns I have calculated the average return rate over the years.
First column no.1 has a list of dates. Column no.2 has my contribution. Column no.3 has the average return.
I would like to do the following if statement: if(column2<column3)return(column1)
This is so I can see the date my returns become more than my contributions.
This code assumes that column1 is A, column2 is B and column3 is C.
the formula for the IF statement is:
first the thing you want to test
next the return value if true
last the return value if false.
I have set false to return 0, but you might want something else.
=IF($B1<$C1;$A1;0)

Setting starting and ending values of a filter

I have the a month slicer based on month number, I want to create a filter with the between format like below :
By default, when loading the report the left side will have the value of 1 (the month number of January) and the right side will have the value of the current month (the month number of October in this case)
First create a table using this below code-
month_list = GENERATESERIES(1,MONTH(TODAY()))
Now create the slicer using the Value column. Output will be as below-

How to pick up column by given parameters and then sum-up the column total in Power BI

I've got a table like below. I would like to pickup the column first by given parameters then sum up the total of the column.
For example, by given Parameter of SGD, I would like to sum-up the total amount of column SGD.
Date SO NO. AUD SGD HKD
7/1/2019 SO1 100 105.17 545.74
8/5/2019 SO2 130 122.01 691.13
9/9/2019 SO3 160 150.32 853.55
9/15/2019 SO4 180 169.11 960.25
Thanks
One way to achieve this is to add a new disconnected table Currencies with one column Currency and values AUD, SGD and HKD. Add a slicer for it and make it drop down.
Then create a measure, which will take the value of the slicer and calculate total on the corresponding column, depending on the selection in the slider:
Total = SWITCH(SELECTEDVALUE('Currencies'[Currency]; "AUD");
"AUD"; SUMX('Table'; [AUD]);
"SGD"; SUMX('Table'; [SGD]);
"HKD"; SUMX('Table'; [HKD]);
SUMX('Table'; [AUD]))
SELECTEDVALUE('Currencies'[Currency]; "AUD") will return the value selected in the slicer, or AUD if none or multiple values are selected. See SELECTEDVALUE.
SWITCH will compare this value with a list of possible options (AUD, SGD and HKD) and return corresponding expression (SUMX('Table'; [AUD]), SUMX('Table'; [SGD]) or SUMX('Table'; [HKD])), or some default value if there is no match (SUMX('Table'; [AUD])).
Then use this measure in your report, and it's value will change depending on the selection in the slicer:

Create Calculated Column Based on Teams with Four Wins in Final Round Utilizing DAX

I need a calculated column for champions and runner up. To become a champion, a team must attain 4 wins in a given year in the final round. I just don't know how to translate that for DAX. I want to be able to have a Year Slicer that will show the Champion and Runner Up for a given year in a card.
I have tried a summary table and using TOPN, but since the count of finalists are all one, I am getting no luck. In the picture below, I would like a column delegating if a team is a champion or runner up
Create a new column by clicking in the Modeling tab and selecting 'New Column". Using the code below I created a new column which takes the column which contains the 'Count of Champions' and IF the number is greater than or equal to 4 then "Champion" is placed in the adjacent column, if the number is below 4, then "Runner Up" is placed in the adjacent column.
Status = IF(Table1[Count of Champions] >= 4, "Champion", "Runner Up")

DAX - Get the value of the most recent record of a column

In Power BI Desktop, I want a calculated measure to get the last value of a given day of column Saldo em EUR:
This is the closing balance of a bank account and the relevant one for each day is the one in the first position, because the bank arranges the bank statement like that and since there's no information about the hour each record took place, this is the only way I can get the closing balance for any given day.
This is what I'm trying:
Saldo do dia = CALCULATE(SUM('BankStatement'[Saldo em EUR]);FILTER('BankStatement';'BankStatement'[Data Valor]=MAX('BankStatement'[Data Valor])))
However this is adding all values of column Saldo em EUR for each day. It is returning 10.632,60 instead of 793,80.
Here's a link for the CSV file: https://drive.google.com/open?id=1vc6c4rV7-NpE1ClbF0dYcWa0PhH4hIMr38QU4EFKuxc
Add INDEX column and for each day pick the value in row with highest/lowest (depending on if index is ascending or descending) INDEX value.