How to get minimum value from range date in DAX - dax

I need to get a calculated measure of the minimum date of a range of values, ie I have a fact table with a date and two measures. When I filter by range date, I need to get the second measure of the minimum date of that range, in the example, the measure 1 of 1st january, something like this:
https://db.tt/6jKBPRCr
The picture on the left is as I have the data in the fact table, data from the right as they should be when I filter from date (from 1st to 6 january). The measure 1 is added for a group, and measure 2 is the minimum value of the range of dates and must be repeated for each resulting record (highlighted).
I need the solution for PowerBI Desktop (DAX)
I would greatly appreciate your help with this.
Thank you for your time

Related

Power Bi matrix subtotal is not the sum of the values in the column

I am trying to create a "meetingroom occupancy" matrix in Power BI. The raw data contains bookings per day per Room. The maximum daily available time per room is 12 hours. I have created a Date Dimension Table for the dates.
I have tried to change datatypes, added the available time column in the query editor, added the available time as DAX column and as calculated measure, but all with no success. I have changed the available time for Room B to 1, and the result of the Subtotal was 13, so it looks like subtotals is only summing unique values, but I do not know how to solve this.
Could someone please explain to me what is happening and how I could solve this?
The input data is as follows:
And my Date_Dimension is as follows:
This is the current and desired result:

DAX comparison operations do not support comparing values of type True/False with values of type Integer

Hi I am looking to complete a vlookup to determine rate costs. I have created a date calendar that contains bank holidays and created a relationship with my main data set. if a job was completed on a sunday or a bank holiday it would be rate 3 or if it mon-fri after 6pm and anytime saturday then rate 2 and all others rate 1. I have tried completing a vlookup howerver it show an error "DAX comparison operations do not support comparing values of type True/False with values of type Integer". i am only learning power BI and any help would be greatly appreciated.
I have columns that show start day, start hour and true/false if it is a bank holiday (Cant seem to add picture)

Datadog: METRIC.as_rate() vs. per_second(METRIC)

I'm trying to figure out the difference between the in-application modifier as_rate() and the rollup function per_second().
I want a table with two columns: the left column shows the total number of events submitted to a Distribution (in query-speak: count:METRIC{*} by {tag}), and the right column shows the average rate of events per second. The table visualization applies a sum rollup on left column, and an average rollup on the right column, so that the left column should equal the right column multiplied by the total number of seconds in the selected time period.
From reading the docs I expected either of these queries to work for the right column:
count:DISTRIBUTION_METRIC{*} by {tag}.as_rate()
per_second(count:DISTRIBUTION_METRIC{*} by {tag})
But, it turns out that these two queries are not the same. as_rate() is the only one that finds the expected average rate where left = right * num_seconds. In fact, the per_second() rollup does this extra weird thing where metrics with lower total events have higher average rates.
Is someone able to clarify why these two functions are not synonymous and what per_second() does differently?

Is there any way to use first and last functions in rpd for one measure column in OBIEE?

I am building an rpd and one of the requirements was the following. We have one measure column DEBIT_ALL in a fact table . This is a sum of all debits that client had since the creation of that client's account. That is this sum always accumulated whenever there is an debit operation.
So in OBIEE users create analysis to see the Debit_all value for some period using date1 and date2 in filters, or just giving month or year value. The easiest way to calcute this amount for some period is to substract sum in date1-1 from sum in date2.
That is value of debit_all measure for period from date1 to date2 is equal to:
value in date2 - value in (date1-1)
Can we do this in rpd admin tool? I had an idea to use first and last functions but couldnt find a proper way.

Functions to calculate max windspeed, average winspeed and median

I am totally new to data structure and algorithms. As much as i am learning and trying to pick up the various functions i was asked to display 5 sets of data structure based on a sample data in csv.
Each file contains a year’s worth of data for multiple sensors. Data for each date-time recording are on separate rows. Within each row, the value for each sensor is separated by a comma. There are a total of 105,120 rows per year/file. Currently the client has 10 years of data which is a million records.
I am supposed to find out:
The maximum wind speed of a specified month and year.
The median wind speed of a specified year.
Average wind speed for each month of a specified year. Display the data in the order of month (Jan, Feb, Mar, ...)
Total solar radiation for each month of a specified year. Display the data in a descending order of the solar radiation (i.e. month with the highest total solar radiation will display first).
Given a date, show the times for the highest solar radiation for that date. There can be one or more time values with the same highest solar radiation. Display the list of times in descending order (e.g. 24:00, 23:00, 22:00, etc.)
As i am new to Data structure. I have been cracking hard on the type of algorithms to propose on the above.
I am thinking if i can use:
BST Binary Search Tree to solve Qns 1
Linear for Qns 2
Constant to sort and linear to find the average for Qns 3
Both linear for Qns 4 and 5.
Anyone have a better suggestion or sample pseudo code to share on this. Or how should i start.
Regards, Heaptie

Resources