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

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.

Reply
Rajamanikandan
New Member

DAX - Need help to reflect filters/slicer value in Measure

Need help to reflect filters/slicer value in Measure

No.of Payments = CALCULATE(COUNT('tstData'[Pay_Amt]),ALLEXCEPT('tstData','tstData'[ID],'tstData'[Name]),'tstData'[Pay_Date] in ALLSELECTED('tstData'[Pay_Date]))

 

No.of Payments values to be adjusted, based on date slicer values

 

Quest.JPG

Sample Data

ID,Name,Pay_Type,Pay_Amt,Pay_Date
1,Name 1,ABC,102.65,8/1/2020
1,Name 1,BCD,2001.14,8/11/2020
1,Name 1,CDE,234.5,8/13/2020
1,Name 1,DEF,102.65,9/1/2020
1,Name 1,EFG,1023.43,9/5/2020
1,Name 1,FGH,23.47,9/15/2020
1,Name 1,GHI,2054.78,10/1/2020
1,Name 1,HIJ,3468.01,10/15/2020
2,Name 2,ABC,703.65,8/1/2020
2,Name 2,BCD,1101.25,8/11/2020
2,Name 2,CDE,3424.5,8/13/2020
2,Name 2,DEF,1702.65,9/1/2020
2,Name 2,EFG,103.43,9/5/2020
2,Name 2,FGH,236.47,9/15/2020

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

@Rajamanikandan assume slice comes from a date table, which have a one to many relationship between 'DateTable'[Date] and 'tstData'[Pay_Date]. then try this code

No.of Payments = CALCULATE(COUNT('tstData'[Pay_Amt]),ALL('tstData'),VALUES('tstData'[ID]),VALUES('tstData'[Name]),'tstData'[Pay_Date] IN ALLSELECTED('DateTable'[Date]))

'DateTable'[Date] 

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

@Rajamanikandan assume slice comes from a date table, which have a one to many relationship between 'DateTable'[Date] and 'tstData'[Pay_Date]. then try this code

No.of Payments = CALCULATE(COUNT('tstData'[Pay_Amt]),ALL('tstData'),VALUES('tstData'[ID]),VALUES('tstData'[Name]),'tstData'[Pay_Date] IN ALLSELECTED('DateTable'[Date]))

'DateTable'[Date] 

@wdx223_Daniel 

 

It works. Thank you so much.

 

Result.JPG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors