Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Folks,
I have following DAX syntax, which is working fine but, when I'm trying the date slicer and filter it is not changing the table values and output. I tried to add date filter inside the DAX but somehow I am not able to figure it out.
Measure 3 =
var a = CALCULATE(MIN('Table'[Index]),ALLEXCEPT('Table','Table'[Fund]))
var b = CALCULATE(MAX('Table'[Price]),FILTER(ALLEXCEPT('Table','Table'[Fund]),'Table'[Index] = a))
return
IF(MAX('Table'[Index])=a,BLANK(),MAX('Table'[Price])-b)
Could you please me in implementing the date filter ?
Here is table output I'm getting from the Query but when imposing date filter it is not changing my outputs.
Index | Fund | Price | Date | Measure | Measure 2 | Measure 3 |
1 | A | 108 | 1/1/2019 0:00 | 1 | 108 | |
2 | A | 101.52 | 1/2/2019 0:00 | 1 | 108 | -0.06 |
3 | A | 107.6112 | 1/3/2019 0:00 | 1 | 108 | 0 |
4 | A | 96.85008 | 1/4/2019 0:00 | 1 | 108 | -0.1 |
5 | A | 99.75558 | 1/5/2019 0:00 | 1 | 108 | -0.08 |
6 | A | 109.7311 | 1/6/2019 0:00 | 1 | 108 | 0.02 |
7 | D | 103 | 1/1/2019 0:00 | 7 | 103 | |
8 | D | 98.88 | 1/2/2019 0:00 | 7 | 103 | -0.04 |
9 | D | 100.8576 | 1/3/2019 0:00 | 7 | 103 | -0.02 |
10 | D | 98.84045 | 1/4/2019 0:00 | 7 | 103 | -0.04 |
11 | D | 89.94481 | 1/5/2019 0:00 | 7 | 103 | -0.13 |
12 | D | 93.5426 | 1/6/2019 0:00 | 7 | 103 | -0.09 |
13 | D | 86.05919 | 1/7/2019 0:00 | 7 | 103 | -0.16 |
14 | D | 80.03505 | 1/8/2019 0:00 | 7 | 103 | -0.22 |
Solved! Go to Solution.
hi,
According to your description, please try this measure.
Test =
var a = CALCULATE(MIN(Table4[Index]),FILTER(ALLSELECTED(Table4),Table4[Fund]=MAX('Table4'[Fund])))
var b = CALCULATE(MAX(Table4[Price]),FILTER(ALLEXCEPT(Table4,Table4[Fund]),Table4[Index]=a))
return
IF(MAX(Table4[Index])=a,BLANK(),MAX(Table4[Price])-b)
The result shows as follows.
Here is my pbix file.
If you still have questions about this, please for free to let me know.
Best Regards,
Giotto Zhi
hi,
According to your description, please try this measure.
Test =
var a = CALCULATE(MIN(Table4[Index]),FILTER(ALLSELECTED(Table4),Table4[Fund]=MAX('Table4'[Fund])))
var b = CALCULATE(MAX(Table4[Price]),FILTER(ALLEXCEPT(Table4,Table4[Fund]),Table4[Index]=a))
return
IF(MAX(Table4[Index])=a,BLANK(),MAX(Table4[Price])-b)
The result shows as follows.
Here is my pbix file.
If you still have questions about this, please for free to let me know.
Best Regards,
Giotto Zhi
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |