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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

What am I not doing here...?

Am I being really stupid...I cannot get this DAX to work.  I have the field Activity[Event Date] but this DAX is adding an extra element to it i.e. Activity[Event Date].[Date]

This is clearly what is causing the issue but I'm not entirely sure how to add this [Date] element to make this work.  Thanks in advance.  Here's the entire script for your reference:

 

IR Lookup Exam Date Range =
VAR _start = 'SLAM Data May 24'[Admission Date]
VAR _end = 'SLAM Data May 24'[Discharge Date]
VAR _key = 'SLAM Data May 24'[PMI]

VAR _singleDateExam =
    LOOKUPVALUE(
        Activity[Examinations],
        Activity[Event Date].[Date], _start,
       Activity[Best Hosp No], _key
    )

VAR _multiDateExams =
    CALCULATE(
        CONCATENATEX(
            FILTER(
               Activity,
               Activity[Event Date].[Date] >= _start &&
               Activity[Event Date].[Date] <= _end &&
               Activity[Best Hosp No] = _key
            ),
          Activity[Examinations],
            ", "
        )
    )

RETURN
IF(
    ISBLANK(_end),
    _singleDateExam,
    _multiDateExams
)
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Creative_tree88 , Try using updated measure

IR Lookup Exam Date Range =
VAR _start = 'SLAM Data May 24'[Admission Date]
VAR _end = 'SLAM Data May 24'[Discharge Date]
VAR _key = 'SLAM Data May 24'[PMI]

VAR _singleDateExam =
LOOKUPVALUE(
Activity[Examinations],
Activity[Event Date], _start,
Activity[Best Hosp No], _key
)

VAR _multiDateExams =
CALCULATE(
CONCATENATEX(
FILTER(
Activity,
Activity[Event Date] >= _start &&
Activity[Event Date] <= _end &&
Activity[Best Hosp No] = _key
),
Activity[Examinations],
", "
)
)

RETURN
IF(
ISBLANK(_end),
_singleDateExam,
_multiDateExams
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Creative_tree88 , Try using updated measure

IR Lookup Exam Date Range =
VAR _start = 'SLAM Data May 24'[Admission Date]
VAR _end = 'SLAM Data May 24'[Discharge Date]
VAR _key = 'SLAM Data May 24'[PMI]

VAR _singleDateExam =
LOOKUPVALUE(
Activity[Examinations],
Activity[Event Date], _start,
Activity[Best Hosp No], _key
)

VAR _multiDateExams =
CALCULATE(
CONCATENATEX(
FILTER(
Activity,
Activity[Event Date] >= _start &&
Activity[Event Date] <= _end &&
Activity[Best Hosp No] = _key
),
Activity[Examinations],
", "
)
)

RETURN
IF(
ISBLANK(_end),
_singleDateExam,
_multiDateExams
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.