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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
craig811
Helper III
Helper III

Show Matched or Missing instead of True and False

Hi,

 

My calulation below is showing values True or False:

Missing Invoices From Sales By GL = CALCULATE( COUNTROWS('Sales Invoices by GL Account'), FILTER( 'Sales Invoices by GL Account', 'Sales Invoices by GL Account'[Invoice Number] = EARLIER('VAT Report - VAT Return'[Invoice Number]) ) ) > 0

 

I want to show 'Matched' if the invoice is found in both reports and 'Missing' if not found, however it just shows Ture and False in my results. I am not sure how to change the values.

 

Thank you in advance 

2 ACCEPTED SOLUTIONS
AlB
Community Champion
Community Champion

@craig811

 

Or this, without the variable:

 

Missing Invoices From Sales By GL =
IF (
    CALCULATE (
        COUNTROWS ( 'Sales Invoices by GL Account' ),
        FILTER (
            'Sales Invoices by GL Account',
            'Sales Invoices by GL Account'[Invoice Number]
                = EARLIER ( 'VAT Report - VAT Return'[Invoice Number] )
        )
    )
        > 0,
    "Matching",
    "Missing"
)

 

Code formatted with   www.daxformatter.com

View solution in original post

Thank you, that was the solution I was looking for.

View solution in original post

5 REPLIES 5
AlB
Community Champion
Community Champion

Hi @craig811

 

Are the TRUE and FALSE that you get now correct already, I mean, would you just want to have ' Matched'  in place of TRUE and 'Missing'  in place of FALSE? 

Thank you for the reply.

 

Yes, the Ture and False values are correct. However, I just want to rename them 'Matched' for True and Missing' for False, within my above formula.

 

Thank you 

AlB
Community Champion
Community Champion

@craig811

 

Ok, then try this, which reuses your code:

 

Missing Invoices From Sales By GL =
VAR _Result =
    CALCULATE (
        COUNTROWS ( 'Sales Invoices by GL Account' ),
        FILTER (
            'Sales Invoices by GL Account',
            'Sales Invoices by GL Account'[Invoice Number]
                = EARLIER ( 'VAT Report - VAT Return'[Invoice Number] )
        )
    )
        > 0
RETURN
    IF ( _Result, "Matched", "Missing" )
AlB
Community Champion
Community Champion

@craig811

 

Or this, without the variable:

 

Missing Invoices From Sales By GL =
IF (
    CALCULATE (
        COUNTROWS ( 'Sales Invoices by GL Account' ),
        FILTER (
            'Sales Invoices by GL Account',
            'Sales Invoices by GL Account'[Invoice Number]
                = EARLIER ( 'VAT Report - VAT Return'[Invoice Number] )
        )
    )
        > 0,
    "Matching",
    "Missing"
)

 

Code formatted with   www.daxformatter.com

Thank you, that was the solution I was looking for.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.