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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Fsciencetech
Helper III
Helper III

Earlier Function

Hi All,

 

Need your help to resolve one logic on dax.

 

Trying on DAX as below but getting error -"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value"

 

SWITCH( TRUE(), FILTER(OSMS_Recomit, OSMS_Recomit[OSMaterialRecoveryDate] = EARLIER(OSMS_Recomit[OSMaterialRecoveryDate])), "Same", FILTER(OSMS_Recomit, OSMS_Recomit[OSMaterialRecoveryDate] > EARLIER(OSMS_Recomit[OSMaterialRecoveryDate])),"Pushout", FILTER(OSMS_Recomit, OSMS_Recomit[OSMaterialRecoveryDate] < EARLIER(OSMS_Recomit[OSMaterialRecoveryDate])),"PullIn","NA" )

 


  

 

4 REPLIES 4
Fsciencetech
Helper III
Helper III

Hi Matt,

Thanks for your reply,

Suppose the IF condition, The below logic is not realted to DAX function, only explaing the logic that How can implement on DAX

 

If(OSMaterialRecoveryDate = Previous(OSMaterialRecoveryDate), "Same",

If(OSMaterialRecoveryDate > Previous(OSMaterialRecoveryDate), "Pushout",

If(OSMaterialRecoveryDate < Previous(OSMaterialRecoveryDate), "Pullin","NA")))

Hi @Fsciencetech ,

 

Use the followng measure based on your logic:

 


SWITCH(True(),OSMaterialRecoveryDate = Previous(OSMaterialRecoveryDate, "Same",

OSMaterialRecoveryDate > Previous(OSMaterialRecoveryDate), "Pushout",

OSMaterialRecoveryDate < Previous(OSMaterialRecoveryDate), "Pullin","NA")))

 

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

 

Best Regards,

Dedmon Dai

What do you mean by "Previous"?  What are you trying to do?  What tables and relationships do you have?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
MattAllington
Community Champion
Community Champion

the formula looks fundamentally flawed to me. Lines 4-8 (the filter) return a table. But you are using switch true, so this section must return a true/false expression, not a table. The same applies to the other sections. 

02CAD7C2-4853-4EA8-8125-63B229A60BED.png



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.