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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Dynamic value in measure

Total =
var _nl ="
"
var _selected = CONCATENATEX(VALUES('Commitment Rundown'[Date]),FORMAT('Commitment Rundown'[Date],"dd-mmm-yy"),_nl)
return 
CALCULATE(DISTINCTCOUNT('Commitment Rundown'[LTP]),
    FILTER('Commitment Rundown',FIND(FORMAT([Baseline Finish WE],"dd-mmm-yy"),_selected,1,-2)<>-2 &&
                                FIND(FORMAT([RFSU Forecast WE],"dd-mmm-yy"),_selected,1,-2)<>-2))
 
Hi y'all. Here's the dax formula. And it doesn't work as it should be, because it doesn't get you the selected value inside the formula but only on exit, checked with visual.
Is there any way to do this?
I want to filter out the data so my other two dates [baseline finish] and [RFSU forecast] are in the range of selected date.
It's in same table so the option with the date table joined to main table won't work cause one relationship will be inactive, unless I miss something
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try the following DAX formula and check if they can solve the problem:

Total = 
VAR _selectedDates = VALUES('Commitment Rundown'[Date])
RETURN
CALCULATE(
    DISTINCTCOUNT('Commitment Rundown'[LTP]),
    FILTER(
        'Commitment Rundown',
        'Commitment Rundown'[Baseline Finish WE] IN _selectedDates &&
        'Commitment Rundown'[RFSU Forecast WE] IN _selectedDates
    )
)

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please try the following DAX formula and check if they can solve the problem:

Total = 
VAR _selectedDates = VALUES('Commitment Rundown'[Date])
RETURN
CALCULATE(
    DISTINCTCOUNT('Commitment Rundown'[LTP]),
    FILTER(
        'Commitment Rundown',
        'Commitment Rundown'[Baseline Finish WE] IN _selectedDates &&
        'Commitment Rundown'[RFSU Forecast WE] IN _selectedDates
    )
)

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous 
Thank you very much, it works! YAY!!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.