cancel
Showing results for
Search instead for
Did you mean:
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
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

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors