cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors