Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Date filter is not working in my DAX

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.

 

IndexFundPriceDateMeasureMeasure 2Measure 3
1A1081/1/2019 0:001108 
2A101.521/2/2019 0:001108-0.06
3A107.61121/3/2019 0:0011080
4A96.850081/4/2019 0:001108-0.1
5A99.755581/5/2019 0:001108-0.08
6A109.73111/6/2019 0:0011080.02
7D1031/1/2019 0:007103 
8D98.881/2/2019 0:007103-0.04
9D100.85761/3/2019 0:007103-0.02
10D98.840451/4/2019 0:007103-0.04
11D89.944811/5/2019 0:007103-0.13
12D93.54261/6/2019 0:007103-0.09
13D86.059191/7/2019 0:007103-0.16
14D80.035051/8/2019 0:007103-0.22

 

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

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.

a-10.PNG

Here is my pbix file.

pbix 

If you still have questions about this, please for free to let me know.

 

Best Regards,

Giotto Zhi

View solution in original post

1 REPLY 1
v-gizhi-msft
Community Support
Community Support

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.

a-10.PNG

Here is my pbix file.

pbix 

If you still have questions about this, please for free to let me know.

 

Best Regards,

Giotto Zhi

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.