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
visheshvats1
Helper I
Helper I

Use measure values on table

I have a fully operational measure that works when I slice the page by a particular Deal Name. I wish to build a table visual with all deals and their respective XIRR values. How do i modify my measure? 

My measure: 

XIRR =
VAR Trantype = {
"Investments Receivable",
"Bond - interest receivable",
"Purchase: security conversion",
"Investment Property",
"Return of Excess Contributions"
}
VAR __Table = UNION(
SELECTCOLUMNS(
FILTER(
'General Ledger',
'General Ledger'[Deal Name]= SELECTEDVALUE('General Ledger'[Deal Name])&&
'General Ledger'[GL Date] >= MIN('Date Table'[Date]) &&
'General Ledger'[GL Date] <= DATE(2024,8,31) &&
'General Ledger'[Trans Type] IN Trantype
),
"GL Date", 'General Ledger'[GL Date],
"Net", 'General Ledger'[Credits only] - 'General Ledger'[Debits only]
),
ROW(
"GL Date", DATE(2024, 8, 31),
"Net", [Net Sheet 1]
)
)
RETURN
XIRR(__Table,[Net],[GL Date])

1 ACCEPTED SOLUTION

Thanks for the prompt reply. But, it gave the same error. 

I just found the solution, the problem was that the Guess Value and Alternate Result was supposed to be added to the XIRR function. As it was unable to calculate XIRR for some of the Deal Names in the table. 

Another change was removing the SELECTEDVALUE filter, for totals to show up in the the table. 

My new Measure: 

}
VAR __Table = UNION(
    SELECTCOLUMNS(
        FILTER(
            'General Ledger',
            'General Ledger'[GL Date] >= MIN('Date Table'[Date]) &&
            'General Ledger'[GL Date] <= DATE(2024,8,31) &&
            'General Ledger'[Trans Type] IN Trantype
        ),
        "GL Date", 'General Ledger'[GL Date],
        "Net", 'General Ledger'[Credits only] - 'General Ledger'[Debits only]  
    ),
    ROW(
        "GL Date", DATE(2024, 8, 31),  
        "Net", [Net Sheet 1]
    )
)
RETURN
XIRR(__Table,[Net],[GL Date],0.1,0)

View solution in original post

2 REPLIES 2
_AAndrade
Super User
Super User

Hi @visheshvats1,

Please try this measure:

IRR All Deals = 
VAR Trantype = {
    "Investments Receivable",
    "Bond - interest receivable",
    "Purchase: security conversion",
    "Investment Property",
    "Return of Excess Contributions"
}
VAR DealTable = VALUES('General Ledger'[Deal Name])
VAR __Table = UNION(
    SELECTCOLUMNS(
        FILTER(
            'General Ledger',
            'General Ledger'[Deal Name] IN DealTable &&  
            'General Ledger'[GL Date] >= MIN('Date Table'[Date]) &&
            'General Ledger'[GL Date] <= DATE(2024,8,31) &&
            'General Ledger'[Trans Type] IN Trantype
        ),
        "GL Date", 'General Ledger'[GL Date],
        "Net", 'General Ledger'[Credits only] - 'General Ledger'[Debits only]
    ),
    ROW(
        "GL Date", DATE(2024, 8, 31),
        "Net", [Net Sheet 1]
    )
)
RETURN
    IF(
        COUNTROWS(__Table) > 1,
        XIRR(__Table, [Net], [GL Date]),
        BLANK()  
    )




Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Thanks for the prompt reply. But, it gave the same error. 

I just found the solution, the problem was that the Guess Value and Alternate Result was supposed to be added to the XIRR function. As it was unable to calculate XIRR for some of the Deal Names in the table. 

Another change was removing the SELECTEDVALUE filter, for totals to show up in the the table. 

My new Measure: 

}
VAR __Table = UNION(
    SELECTCOLUMNS(
        FILTER(
            'General Ledger',
            'General Ledger'[GL Date] >= MIN('Date Table'[Date]) &&
            'General Ledger'[GL Date] <= DATE(2024,8,31) &&
            'General Ledger'[Trans Type] IN Trantype
        ),
        "GL Date", 'General Ledger'[GL Date],
        "Net", 'General Ledger'[Credits only] - 'General Ledger'[Debits only]  
    ),
    ROW(
        "GL Date", DATE(2024, 8, 31),  
        "Net", [Net Sheet 1]
    )
)
RETURN
XIRR(__Table,[Net],[GL Date],0.1,0)

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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