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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

Search with multiple criteria

Hello,

I have a table with more than milion rows with data from different customers. I’m looking for a dax formule that gives me the following result (see column output):

 

ACCOUNT NUMBERINVOICE NUMBER INVOICE AMOUNT TYPE OF INVOICEPERIODEOUTPUT
11111234 €                       19,00Inovice3-20201236
11111235 €                      -19,00Credit7-20201238
11111236 €                      -19,00Credit3-20201234
11111237 €                      -19,00Credit8-20200
11111238 €                       19,00Inovice7-20201235
11111239 €                       19,00Inovice9-20200
11111240 €                       19,00Inovice6-20200
11111241 €                       19,00Inovice6-20200
11121242 €                       19,00Inovice7-20201244
11121243 €                       19,00Inovice8-20201245
11121244 €                      -19,00Credit7-20201242
11121245 €                      -19,00Credit8-20201243

 

 

I am looking for the same (but opposite) invoice for the same period per customer. If this invoice does not appear, result 0 is sufficient.

 

I hope someone can help me with this.

15 REPLIES 15

Hi @Jihwan_Kim , 

I get this as a result: 

angelikakolacz_0-1663153588938.png

A customer may receive more than 1 invoice for a specific periode. Could it be this? 

Hi,

Please share your sample pbix file's link here, and then I can try to look into it.

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 

 

Can you open my link?

 

 

Hi,

Thank you for your message, but I need a link to the pbix file, not a link to the Power BI service.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim ,

 

Can you explain how i can share a link with you? I cann't add a file..

HI,

Thank you for your message.

Instead of attaching a file, please try share the link of your pbix file.

Onedrive link, googledrive link, dropbox link, or any other link....

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi,

As seen in the below picture, some of them shows two invoice numbers. which invoice number do you want to select and show? Or, do you want to show two invoice numbers if there are two?

 

Jihwan_Kim_0-1663832406746.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 

 

Thank you for your answer. I want to see one unique value as output. 
So if the output is multiple output, i only want to see one unique value. If this one is already used as output i want to see another one (if there is another one).

 

Like this example: 

angelikakolacz_0-1663837912030.png

so as output i want to see one value by row. see this example: 
i have crossed out the unnecessary ones

 

angelikakolacz_2-1663838260337.png

 

Hi, Thank you for your information.

I am still a little bit confused. How to select which invoice number is used by which one? 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 
If in the output a value is already used, it's not possible to see them again. in the output i don't want to see double values. Is it possible to use this like a criteria?

Hi,

Thank you for your information.

Sorry to bother you again, but what I meant was, 

in the below picture that you shared,

why first row takes 8100000003181511? why not 810000003181814?

How do you define the difference between the first row and the second row?

 

Jihwan_Kim_0-1663847223179.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim 

 

It's only an example. it doesn't matter which one you take, if the value is unique (not already used before) it's oke.

Hi @Jihwan_Kim 

 

what I actually want to see is how many invoices are 0 (credit + debet) on balance if;

- it's the same account number,
- period it's the same

- sum of two invoices is 0.

 

But it is possible that in my file for a periode are 5 debet invoices and 4 credit invoices (same period). so 8 of them are right, but one is not good. In mine results i want to show that.

 

I must be able to show my results on row level, hence a new column with output.

 

Jihwan_Kim
Super User
Super User

Hi,

Based on what I see in the sample, I tried to write DAX formula like below in order to create a calculated column.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1663146878718.png

 

Output CC =
VAR _result =
    SUMMARIZE (
        FILTER (
            Data,
            Data[ACCOUNT NUMBER] = EARLIER ( Data[ACCOUNT NUMBER] )
                && Data[PERIODE] = EARLIER ( Data[PERIODE] )
                && Data[INVOICE AMOUNT]
                    = -1 * EARLIER ( Data[INVOICE AMOUNT] )
        ),
        Data[INVOICE NUMBER]
    )
RETURN
    _result + 0

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.