Monthly historical data as per chart - google-finance

how can i get monthly price data of previous month OHLC in google sheets using google finance formula as per candle in chart
or any similar formula like for weekly as below for monthly
INDEX(QUERY(GOOGLEFINANCE($A$10,"open",TODAY()-30,TODAY(),"WEEKLY"),"select Col2 where Col1 < date'"&TEXT(TODAY(),"yyyy-mm-dd")&"' and Col1 > date'"&TEXT(TODAY()-7,"yyyy-mm-dd")&"' limit 1"),2)

Related

How to create time series visualisation in power BI

I'm new to Power BI online but trying to create a time-series chart with sum of sales by month, year and split by country. My result is:
What am I doing wrong?
With the Line chart visual selected put the Date hierarchy on the X-axis, Sales on the Y-axis and Country on the Legend field.

Graph a daily amount in between two dates

The source table has a table with a single amount and a revenue start and revenue end date. I need to graph the amount over the period by day in PowerBI.
For example:
Looking at the second row the total amount is 730 but I need to calculate a daily rate and display this each day for the revenue period. So if I had a bar chart for this row I would need to show it as 16 April has 34.76, 17 April has 34.76 and so on until 6 May which is the revenue end date. I've tried using between dates but cant seem to get it working.
You can use Power BI's CALENDAR() function to create a table of dates ranging from the minimum revenue start date to the maximum revenue end date.
Dates = CALENDAR(MIN(BookFees[Revenue Start Date]),MAX(BookFees[Revenue End Date]))
Then you can create a calculated column in the Dates table for the daily revenue.
Daily Revenue = Calculate(SUM(BookFees[RevenueDayAmount]),FILTER(BookFees,BookFees[Revenue Start Date]<=Dates[Date] && BookFees[Revenue End Date]>= Dates[Date]))
Here is the resulting bar chart:

Month field is not getting drill down in power bi

I am calculating total revenue over the years.
There are two tables calendar and sales. I have calculated total revenue using DAX now I want to display total revenue in each year.
The month field is not getting filtered for the Revenue column, I have attached a snip for reference.
Total revenue(DAX)= total revenue = SUMX(AW_Sales,AW_Sales[OrderQuantity] * RELATED(AW_Products_Lookup[ProductPrice]))

Power BI, cumulative sum Monthly Reports display in a Yearly Chart

In Power BI, I have a bunch of cumulative sum monthly reports example current Employee count
so in line charts, it automatically shows the dates as years in the X-axis. you can drill down to see the monthly details of any year. by default the chart SUM all the months to show the year. i want the chart to show the last month's value from every year at the year level
if I showed the report in a line chart
at monthly level ( no issue) if i dril up
at year level (it should show the value for December , PBI "SUM" the values which is wrong,)
I tried
count for December =
CALCULATE(
SUM('data'[count]),
'data'[Date].[Month] IN { "December" },
ALL('data'[Date].[MonthNo])
)
at year level ( no issue) if i drill dawon
at month level (it should show the value for December for all months)

Power BI Sum by Category and Month

I have a Power BI/DAX question. I'm looking to summarize my data by getting monthly transaction sums (including the year as well, i.e. MM/YY) and filtering them by individual account numbers. Here is an example:
I want to take that and make it into this:
I converted the dates to the format I want with this code: 
Transaction Month = MONTH(Table[Date]) & "/" & YEAR(Table[Date])
Then got the total monthly sum:
Total Monthly Sum = CALCULATE(sum(Table[Transaction Amount]),ALLEXCEPT(Table, Table[Transaction Month]))
Now I'm trying to figure out how to filter the total monthly sum by individual account numbers. Just as a note - I need this to be a calculated column as well because I'll want to identify accounts that surpass individual account monthly spending limits. Can anyone help me with this?
Thanks so much!
When working with calendar dates, it pays to have a calendar table linked to the transaction table. In the calendar table you will have each date, from the start date of your relevant time period to the end of the time period relevant to your data. The columns of the calendar table can then contain calculations on that date like month number, month name, year, year-month key, transaction month (as the first day of the month for the date in that row), etc.
Next, connect the two tables in the data model by dragging the transaction date to the calendar date column.
Now you can build charts and report tables that group data by month without writing any complicated DAX. Just pull the field "transaction month" from the calendar table and the Total Sum measure from the transaction table into the field well of the visual.
That's what Power BI is all about.