Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello,
I want to convent this code into measure but able to do it with replace of fix number with selected value,
Please can anyone help me out?
Months in excel = 
IF(OR(ServiceModel[Month].[Year] = 2021 && ServiceModel[Month].[MonthNo] = 12,OR(ServiceModel[Month].[Year] = 2021 && ServiceModel[Month].[MonthNo] = 11, OR(ServiceModel[Month].[Year] = 2021 && ServiceModel[Month].[MonthNo] = 10, ServiceModel[Month].[Year] = 2021 && ServiceModel[Month].[MonthNo] = 9))), "Y", "N")Hi @OvaisJanzeb ,
Try this:
Months in excel =
IF (
    SELECTEDVALUE ( ServiceModel[Month] ) >= DATE ( 2021, 9, 1 )
        && SELECTEDVALUE ( ServiceModel[Month] ) <= DATE ( 2021, 12, 31 ),
    "Y",
    "N"
)
You can refer this function: SELECTEDVALUE function - DAX | Microsoft Docs
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@OvaisJanzeb , Try new measure
new measure = 
var _Date = max(ServiceMo[Month])
return 
if( _date >= Date(2021,09,01) && _date <= DAte(2021,12,21), "Y", "N")
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 80 | |
| 49 | |
| 35 | |
| 31 | |
| 30 |