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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Libin7963
Helper II
Helper II

Help required for DAX FUNCTION

In the below meaure the bolded part doesn't filter or make any difference to the outcome.  when I apply the same filter in filter pane it works.  

SelectedStartDate = FIRSTDATE(DateTable[Date]) and there is a relation between table1 and Datetable.

 

Please help.

 

Q1.a New =
CALCULATE(
COUNTROWS(
FILTER(
TABLE1,
(TABLE1[Type] = "A" ||
TABLE1[Type] = "B" ||
TABLE1[Type] = "C" ||
TABLE1[Type] = "D" ||
TABLE1[Type] = "E" ||
TABLE1[Type] = "F" ||
TABLE1[Type] = "G" ||
TABLE1[Type] = "H" ||
TABLE1[Type] = "I") &&
(ISBLANK(TABLE1[DECISIONDATE]) || TABLE1[DECISIONDATE] >= [SelectedStartDate]) && TABLE1[VALIDDATE]<[SelectedStartDate]
)
)
)

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Libin7963 Try simplifying this and this is my best guess as to the logic you are going for.

Measure =
  VAR __Table = 
    FILTER( 
      'TABLE1',
      [Type] IN { "A", "B", "C", "D", "E", "F", "G", "H", "I" } &&
      ( 
        ISBLANK([DECISIONDATE]) || 
        [DECISIONDATE] >= [SelectedStarteDate] && [VALIDDATE]] < [SelectedStartDate]
      )
    )
  VAR __Result = COUNTROWS( __Table )
RETURN
  __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Libin7963 Try simplifying this and this is my best guess as to the logic you are going for.

Measure =
  VAR __Table = 
    FILTER( 
      'TABLE1',
      [Type] IN { "A", "B", "C", "D", "E", "F", "G", "H", "I" } &&
      ( 
        ISBLANK([DECISIONDATE]) || 
        [DECISIONDATE] >= [SelectedStarteDate] && [VALIDDATE]] < [SelectedStartDate]
      )
    )
  VAR __Result = COUNTROWS( __Table )
RETURN
  __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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