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
Miguel05
Regular Visitor

DAX Measure which Filter values from Table

Hi all!

I am trying to achieve two measures which give me the following:

  1. The total Amount Invoiced of Projects which have an Amount Invoiced greater than 100K.
  2. A count of projects which have a Amount Invoiced greater than 100K.

 

The following table represent the values that I am looking for. So for the measure 1) I am trying to achieve the value of 4,001,015 and for the measure 2) I am trying to achieve the number of 19.

Miguel05_2-1606319932730.png

 

These values are coming from a Table named "Project Transactions", and I am using two Fields: “Project Name” and “Amount Invoiced”. This table is also filtered to when the Amount Invoiced is greater than 100K. 

 

This seems a straight foward problem, but for some reason I am not being successful. I already tried to use Calculate function, and it didnt work the way I want it. 

Any tip on how to solve this? I would be very appreciated!

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Please try this measure expression

 

Invoiced Over 100k =
VAR vSummary =
    SUMMARIZE (
        'Project Transactions',
        'Project Transactions'[Project Name],
        "cInvoiced"SUM ( 'Project Transactions'[Amount Invoided] )
    )
RETURN
    SUMX (
        FILTER (
            vSummary,
            [cInvoiced] >= 100000
        ),
        [cInvoiced]
    )

 

For your count measure, just change the Return to COUNTROWS(FILTER(vSummary, [cInvoiced] >=100000))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
Miguel05
Regular Visitor

Thank you both for tour suggestions 🙂 

amitchandak
Super User
Super User

@Miguel05 , Try a measure like

sumx(values(Table[Project Name]), if([Amount Invoiced]>100000, [Amount Invoiced], blank()))

mahoneypat
Employee
Employee

Please try this measure expression

 

Invoiced Over 100k =
VAR vSummary =
    SUMMARIZE (
        'Project Transactions',
        'Project Transactions'[Project Name],
        "cInvoiced"SUM ( 'Project Transactions'[Amount Invoided] )
    )
RETURN
    SUMX (
        FILTER (
            vSummary,
            [cInvoiced] >= 100000
        ),
        [cInvoiced]
    )

 

For your count measure, just change the Return to COUNTROWS(FILTER(vSummary, [cInvoiced] >=100000))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.