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
Nihed
Helper III
Helper III

Rule with dax

Hello,

 

How do i apply this rule in dax please

IF 'PPM'[Steps] in {"Open for competition","Technical Evaluation Stage","Financial Evaluation Stage","Procurement Board","Legal Review","Contract Signature",""} then AMOUNT = 'PPM'[Estimated Amount]

IF 'PPM'[Steps] = "Process Finalized"  then AMOUNT = 'PPM'[Cumulated Contract Amount]

Thank you

1 ACCEPTED SOLUTION

@Nihed  I believe you are looking for this, pbix is attached

 

Column 2 =
IF (
    PPM[Process Steps]
        IN {
        "Open for Competition",
        "Technical Evaluations",
        "Financial Negotiations",
        "Procurement Board",
        "Legal Review",
        "Signature",
        ""
    },
    PPM[Estimated Amount],
    IF ( PPM[Process Steps] IN { "Finalised" }, PPM[Cumulated Contract Amount] )
)

 

else

Column = SWITCH(TRUE(),
                CONTAINSSTRING(PPM[Steps],"Open for competition")=TRUE()||
                CONTAINSSTRING(PPM[Steps],"Technical Evaluation Stage")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Financial Evaluation Stage")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Procurement Board")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Legal Review")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Contract Signature")=TRUE() , PPM[Estimated Amount],
                CONTAINSSTRING(PPM[Steps],"Process Finalized")=TRUE(), PPM[Cumulated Contract Amount])

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

7 REPLIES 7
smpa01
Super User
Super User

@Nihed 

switch(true(), 
     'PPM'[Steps] in {"Open for competition","Technical Evaluation Stage","Financial Evaluation Stage","Procurement Board","Legal Review","Contract Signature",""} 
	 ,'PPM'[Estimated Amount]
	 'PPM'[Steps] = "Process Finalized", 'PPM'[Cumulated Contract Amount])
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

I did it like this but it doesn’t work 😕

 

@Nihed  provide some more details then; e.g. sample data and expected output

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

This KPI is displayed in the following table:

Nihed_0-1638471156675.png

 

I must calculate the AMOUNT field

The metric is defined below:

KPI

Source

Filters

Source fields

Rules

Amount

PPM tab

Type = “CFT”

Cumulated Contract Amount

Estimated Amount

IF 'PPM'[Steps] in {"Open for competition","Technical Evaluation Stage","Financial Evaluation Stage","Procurement Board","Legal Review","Contract Signature",""} then AMOUNT = 'PPM'[Estimated Amount]

IF 'PPM'[Steps] = "Process Finalized"  then AMOUNT = 'PPM'[Cumulated Contract Amount]

 

@Nihed  please provide sample data in table format

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

I share with you the link for the example of data in pbix.

Thank you

 

https://we.tl/t-WJgFSTmRDC 

@Nihed  I believe you are looking for this, pbix is attached

 

Column 2 =
IF (
    PPM[Process Steps]
        IN {
        "Open for Competition",
        "Technical Evaluations",
        "Financial Negotiations",
        "Procurement Board",
        "Legal Review",
        "Signature",
        ""
    },
    PPM[Estimated Amount],
    IF ( PPM[Process Steps] IN { "Finalised" }, PPM[Cumulated Contract Amount] )
)

 

else

Column = SWITCH(TRUE(),
                CONTAINSSTRING(PPM[Steps],"Open for competition")=TRUE()||
                CONTAINSSTRING(PPM[Steps],"Technical Evaluation Stage")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Financial Evaluation Stage")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Procurement Board")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Legal Review")=TRUE() ||
                CONTAINSSTRING(PPM[Steps],"Contract Signature")=TRUE() , PPM[Estimated Amount],
                CONTAINSSTRING(PPM[Steps],"Process Finalized")=TRUE(), PPM[Cumulated Contract Amount])

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

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