Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ldgary
New Member

Getting a table total into a measure

I have a Power BI report that has some complicated measures, most of which I've figured out. One that I can't seem to get is a measure that shows the number of transactions for those sales within a specified range. This is what I have now with incorrect Transaction Counts:

 

ldgary_0-1749129339122.png

This table shows the data that comprises of what I need to see in the Transaction Count:

ldgary_4-1749134182723.png

 

The highlighted total is the amount I need. Here is the DAX for the TY Invoice Count measure:

 

ldgary_2-1749129458874.png

Here is my Transaction Count measure that isn't giving me what I need:

ldgary_3-1749131206572.png

 

All of the other amounts are directly from the semantic model that is used for the report. Are there any ideas of how I can accomplish this?

1 ACCEPTED SOLUTION

After reviewing the screenshot again, it looks like we first need to aggregate the sales by SellToNo. The previous measure was aggreageting by the Invoice. Please try this one instead:

Transaction Count > $100,000 =
SUMX(
    FILTER(
        VALUES(Fact_Invoice[SellToNo]),
        CALCULATE(SUM(Fact_Invoice[NetSales])) > 100000
    ),
    [TY Invoice Count] 
)

 

View solution in original post

7 REPLIES 7
SamsonTruong
Super User
Super User

Hi @ldgary ,

 

Please try the following adjusted DAX for your transaction count measure and let me know if it achieves the desired result:

Transaction Count > $100,000 = 
VAR InvoicesOver100K =
    FILTER(
        SUMMARIZE(
            Fact_Invoice,
            Fact_Invoice[InvoiceNo],
            "TotalSales", SUM(Fact_Invoice[NetSales])
        ),
        [TotalSales] > 100000
    )
RETURN
    COUNTROWS(
        FILTER(
            InvoicesOver100K,
            CALCULATE(
                SELECTEDVALUE(Dim_TransActSalesPerson[SalesPersonName])
            ) = SELECTEDVALUE(Dim_TransActSalesPerson[SalesPersonName])
        )
    )

 

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson



Thanks, @SamsonTruong, but this didn't work for me.

 

ldgary_0-1749140960197.png

 

Hi @ldgary ,

Can we try the following without the sales person reference to see if this gets us closer:

Transaction Count > $100,000 =
CALCULATE(
    COUNTROWS(
        FILTER(
            SUMMARIZE(
                Fact_Invoice,
                Fact_Invoice[InvoiceNo],
                "TotalSales", SUM(Fact_Invoice[NetSales])
            ),
            [TotalSales] > 100000
        )
    )
)

It's still blank.

After reviewing the screenshot again, it looks like we first need to aggregate the sales by SellToNo. The previous measure was aggreageting by the Invoice. Please try this one instead:

Transaction Count > $100,000 =
SUMX(
    FILTER(
        VALUES(Fact_Invoice[SellToNo]),
        CALCULATE(SUM(Fact_Invoice[NetSales])) > 100000
    ),
    [TY Invoice Count] 
)

 

That was it, and it was so simple, thank you!

 

ldgary_0-1749143103607.png

 

Awesome, glad to hear it worked!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors