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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |