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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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

)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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