The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello noob BI user here,
I have a large table with a set of dates and reliated market values. I have a slicer set up which allows the user to set the time period they want to analyse the data over, i.e betweem Aug 5th 2019 to Sep 5th 2019.
Given the selected start and end period that the user choose to analyse over, using the slicer. I need to create a meaure that records the market value at the start date and end date periods. Below is an example of some dates and data:
Date | MV |
22/04/2019 | 22 |
22/04/2019 | 3423 |
15/06/2019 | 2354 |
01/07/2019 | -456 |
14/09/2019 | 45 |
I used the following code in my measures
Code | MV |
A | 22 |
A | 3423 |
B | 2354 |
C | -456 |
D | 45 |
First Settlement = SUMX(FILTER(test, test[Code] = "A" ), test[MV]) returns 3445
Help me please!
Solved! Go to Solution.
Hi @Anonymous ,
Is this what you are looking for? I did note that one date was duplicated which I changed as I did not think we could have two market values on same date.
First date = FIRSTDATE(markv[Date])
Last Date = LASTDATE(markv[Date])
Market Value First Date = CALCULATE(MAX(markv[MV]),FILTER(markv,MIN(markv[Date])=[First date]))
Market Value Last date = CALCULATE(MAX(markv[MV]),FILTER(markv,MAX(markv[Date])=[Last Date]))
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Hi @Anonymous ,
Is this what you are looking for? I did note that one date was duplicated which I changed as I did not think we could have two market values on same date.
First date = FIRSTDATE(markv[Date])
Last Date = LASTDATE(markv[Date])
Market Value First Date = CALCULATE(MAX(markv[MV]),FILTER(markv,MIN(markv[Date])=[First date]))
Market Value Last date = CALCULATE(MAX(markv[MV]),FILTER(markv,MAX(markv[Date])=[Last Date]))
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Thank you!!!!!!!
In this case you can have two market values on the same date so I use sum in place of max:
Market Value First Date = CALCULATE(sum(markv[MV]),FILTER(markv,MIN(markv[Date])=[First date]))
Thanks Nathaniel for your help
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |