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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

All possible combinations of DAX command

Dear community members,

 

I have the following DAX command: 

IF(MIN(Prijsbeleid[Contract vanaf]) > MIN(Prijsbeleid[Prijs vanaf]) && MIN(Prijsbeleid[Contract vanaf]) > MIN(Datum[Datum]) && MAX(Prijsbeleid[Contract tot]) < MAX(Prijsbeleid[Prijs tot]) && MAX(Prijsbeleid[Prijs tot]) < MAX(Datum[Datum]),1,0)
 
Now, I want to have all possible combinations of this DAX command in one DAX command, such as:
IF(MIN(Prijsbeleid[Contract vanaf]) > MIN(Prijsbeleid[Prijs vanaf]) && MIN(Prijsbeleid[Contract vanaf]) > MIN(Datum[Datum]) && MAX(Prijsbeleid[Contract tot]) < MAX(Prijsbeleid[Prijs tot]) && MAX(Prijsbeleid[Prijs tot]) < MAX(Datum[Datum]),1,
IF(MIN(Prijsbeleid[Contract vanaf]) <= MIN(Prijsbeleid[Prijs vanaf]) && MIN(Prijsbeleid[Contract vanaf]) > MIN(Datum[Datum]) && MAX(Prijsbeleid[Contract tot]) < MAX(Prijsbeleid[Prijs tot]) && MAX(Prijsbeleid[Prijs tot]) < MAX(Datum[Datum]),2,
IF(MIN(Prijsbeleid[Contract vanaf]) > MIN(Prijsbeleid[Prijs vanaf]) && MIN(Prijsbeleid[Contract vanaf]) <= MIN(Datum[Datum]) && MAX(Prijsbeleid[Contract tot]) < MAX(Prijsbeleid[Prijs tot]) && MAX(Prijsbeleid[Prijs tot]) < MAX(Datum[Datum]),3,etc..........)))
 
Is there a way to do this without writing it all down manually?
1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , I doubt any automatic way. But use Switch

https://www.youtube.com/watch?v=gelJWktlR80

Switch( True(),

<condition> , <result>,

<condition> , <result>,

else

)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors