Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
In the below scenario, I have two tables. I am trying to build a measure that returns the value from Table2 associated with the maximum date from Table1 where column Time = "Past".
In this example, I would like my measure to return a value of "700".
I have tried a few different calculations but am struggling to filter one table's date range based on another. Would connecting the tables with an inactive relationship and using RELATED work?
Any help greatly appreciated!
Table1 | |
Date | Time |
Jan-24 | Past |
Feb-24 | Past |
Mar-24 | Past |
Apr-24 | Past |
May-24 | Past |
Jul-24 | Past |
Aug-24 | Past |
Sep-24 | Future |
Oct-24 | Future |
Nov-24 | Future |
Dec-24 | Future |
Table 2 | |
Date | Value |
Jan-24 | 100 |
Feb-24 | 200 |
Mar-24 | 300 |
Apr-24 | 400 |
May-24 | 500 |
Jul-24 | 600 |
Aug-24 | 700 |
Sep-24 | 800 |
Oct-24 | 900 |
Nov-24 | 1000 |
Dec-24 | 1100 |
Solved! Go to Solution.
HI, @PBI12345
If you have relationship b/w both tables on Date Column then try below measure.
Measure =
var Max_date = calculate(max(table1[Date]),table1[time]="Past")
return
calculate(sum(table2[value]),Table2[date]=Max_date)
HI, @PBI12345
If you have relationship b/w both tables on Date Column then try below measure.
Measure =
var Max_date = calculate(max(table1[Date]),table1[time]="Past")
return
calculate(sum(table2[value]),Table2[date]=Max_date)
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |