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! Learn more

Reply
OvaisJanzeb
Frequent Visitor

How to convent Column into Measure DAX

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")
2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

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.

amitchandak
Super User
Super User

@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")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors