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
HBL_Nick
Frequent Visitor

Concetenate for each if value is bigger then

Hi Guys,

 

I want to make a calculated column of who should have approved an invoice, so that I can compare it with who actually approved it.

 

The tables look like this:

 

Workflow:

Workflow.PNG

Invoices:

Invoice.PNG

 

When the Invoice Amount is >= than workflow minimal amount. All the employees uptil that point have to approve it. The output should be like this:

InvoiceWorkflowCombined.PNG

 

So that eventually I could compare who should've approved and who did approve and get the final table:

Exception.PNG

1 ACCEPTED SOLUTION

Hey @HBL_Nick ,

 

I thought you want the first one that would be allowed 😉

Then try the following measure:

Responsible Approver =
VAR vWorkflowID = Invoices[Workflow]
VAR vAmount = Invoices[Amount]
VAR vTable =
    CALCULATETABLE(
        Workflow,
        Workflow[WorkflowID] = vWorkflowID,
        Workflow[MinimalAmount] <= vAmount
    )
RETURN
    CONCATENATEX(
        vTable,
        Workflow[Approver],
        ", "
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

4 REPLIES 4
selimovd
Super User
Super User

Hey @HBL_Nick ,

 

the following calculated column should give you the right Approver:

Responsible Approver =
VAR vWorkflowID = Invoices[Workflow]
VAR vAmount = Invoices[Amount]
VAR vTable =
    CALCULATETABLE (
        Workflow,
        Workflow[WorkflowID] = vWorkflowID,
        Workflow[MinimalAmount] <= vAmount
    )
VAR vFilteredTable =
    FILTER (
        vTable,
        Workflow[MinimalAmount] = MAXX ( vTable, Workflow[MinimalAmount] )
    )
RETURN
    MAXX ( vFilteredTable, Workflow[Approver] )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hi @selimovd, thanks for helping me out 🙂 This is almost the answer to my question, the only thing is: with this answer, I will find the last approver of the workflow / invoice, but I actually would like a list of approvers of the invoice / workflow. For example: an invoice with workflow 1 and a amount of 800, 2 people Should have approved. So the calculated column should contain: "Peter, James". Now it will only contain: "James". 

Hey @HBL_Nick ,

 

I thought you want the first one that would be allowed 😉

Then try the following measure:

Responsible Approver =
VAR vWorkflowID = Invoices[Workflow]
VAR vAmount = Invoices[Amount]
VAR vTable =
    CALCULATETABLE(
        Workflow,
        Workflow[WorkflowID] = vWorkflowID,
        Workflow[MinimalAmount] <= vAmount
    )
RETURN
    CONCATENATEX(
        vTable,
        Workflow[Approver],
        ", "
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hi @selimovd , this is exactly what I needed, thanks for the help!

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.