Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi Masters,
I am pretty new in DAX as well as in Power BI.
Please see below snapshots : Basically I am trying to mark/tag my projects with specific words based on their approval statuses. I have 3 types of approvals and if all have "Yes" I would like to write and tag that project as "F-R-W" whcih stands for "Finance - Risk - Workstream". I am able to do this in excel table where I have one table. However now I am trying to do this in database where I have many tables with relationships. It is not only question around multiple AND conditon with IF, it is also how I can do this in database where I have multiple tables . Please check snapshots and i hope you will understand what I am trying to do.
Excel formula that I used to use:
In DAX - what I am trying to do
Expected DAX outcome:
Regards,
Akito
Solved! Go to Solution.
Hi @akito ,
Try this measure.
Required Approvals =
VAR _finance_approvals =
MAX ( 'Initiative Pending Approval'[Finance Approvals] )
VAR _risk_approvals =
MAX ( 'Initiative Pending Approval'[Risk Approvals] )
VAR _workstream_approvals =
MAX ( 'Initiative Pending Approval'[Workstream Approvals] )
RETURN
SWITCH (
TRUE (),
_finance_approvals = "Yes"
&& _risk_approvals = "Yes"
&& _workstream_approvals = "Yes", "F-R-W",
_finance_approvals = "Yes"
&& _risk_approvals = "Yes"
&& _workstream_approvals = "", "F-R",
_finance_approvals = "Yes"
&& _risk_approvals = ""
&& _workstream_approvals = "", "F"
)
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @akito ,
Try this measure.
Required Approvals =
VAR _finance_approvals =
MAX ( 'Initiative Pending Approval'[Finance Approvals] )
VAR _risk_approvals =
MAX ( 'Initiative Pending Approval'[Risk Approvals] )
VAR _workstream_approvals =
MAX ( 'Initiative Pending Approval'[Workstream Approvals] )
RETURN
SWITCH (
TRUE (),
_finance_approvals = "Yes"
&& _risk_approvals = "Yes"
&& _workstream_approvals = "Yes", "F-R-W",
_finance_approvals = "Yes"
&& _risk_approvals = "Yes"
&& _workstream_approvals = "", "F-R",
_finance_approvals = "Yes"
&& _risk_approvals = ""
&& _workstream_approvals = "", "F"
)
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
@v-cgao-msft hey nice one ..
I am also working and struggling to get one of the IF logic conditions as below :
Logic :
if "Are there any changes between SOW Agreed Scope & Revised Scope?" is Yes and "Is the devaition between SOW Agreed scope and revised scope has major deviation?" is Yes --> Red
if "Is the CR raised?" is yes or No then keep it Red
if "Is the CR raised?" is yes and "Is the CR approved?" is No then keep it Red
if "Is the CR raised?" is yes and "Is the CR approved?" is yes then change it to Green
if "Are there any changes between SOW Agreed Scope & Revised Scope?" is Yes and "Is the devaition between SOW Agreed scope and revised scope has major deviation?" is No --> Amber
if "Is the CR raised?" is yes or No then keep it Amber
if "Is the CR raised?" is yes and "Is the CR approved?" is No then keep it Amber
if "Is the CR raised?" is yes and "Is the CR approved?" is yes then change it to Green
All the above questions are already available in the Sharepoint list source , based on the above logics I have to create a column for the accounts like below .
I have tried this below DAX but not working as expected.
Can you please help to solve this DAX ?..
Thanks
DK
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
23 | |
21 | |
19 | |
13 | |
12 |
User | Count |
---|---|
43 | |
31 | |
24 | |
22 | |
22 |