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
Anno2019
Helper IV
Helper IV

How to tag the order in which invoices have been time stamped?

Hi Guru's

 

Hope someone can assist me.

I am looking for a way to tag the order of which an invoice "IN" [Voucher Type] was made with the following rules.

Look in [File Number] and only look for [Voucher Type] "IN", if the the invoice was the first time stamp then Tag as 1, if invoice was the second time stamp then 2, if invoice was third time stamp then 3 etc etc etc.  if [Voucher Type] is not "IN" then blank.

My table below include two seperate file numbers with various vouchers, my end result I have included in [Voucher Order TAG].

Would really appreciate some help.

 

File NumberVoucher No.Voucher Date TimeVoucher TypeVoucher ValueVoucher Order TAG
ZRTQW190000005905000016408 Aug 2019 13:23:09YQ16 091 
ZRTQW190000005905000028520 Aug 2019 11:06:45IN3 7281
ZRTQW190000005905000091928 Aug 2019 20:44:08ZE360 
ZRTQW190000005905000118302 Sep 2019 13:16:12ZE125 
ZRTQW190000005901000124414 Sep 2019 13:32:42IN45 9342
AAWTEC99847661901000124614 Sep 2019 13:33:06IN4 6041
AAWTEC99847661901000124714 Sep 2019 13:33:38IN18 3832
AAWTEC99847661904000017014 Sep 2019 14:22:04RB23 268 
AAWTEC99847661901000125514 Sep 2019 14:22:30IN23 0443
AAWTEC99847661905000200514 Sep 2019 17:50:42PP5 472 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

create a new column like one given below

countx(filter(table,table[File Number] = earlier(table[File Number]) && table[Voucher Type] ="IN" && earlier(table[Voucher Type])="IN"
&& table[Voucher Date Time]<=earlier(table[Voucher Date Time])),table[File Number])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anno2019 

Create a measure

Measure =
IF (
    MAX ( Sheet2[Voucher Type] ) = "IN",
    CALCULATE (
        COUNT ( Sheet2[File Number] ),
        FILTER (
            ALLSELECTED ( Sheet2 ),
            Sheet2[File Number]
                = MAX ( Sheet2[File Number] )
                && Sheet2[Voucher Type] = "IN"
                && Sheet2[Voucher Date Time]
                    <= MAX ( Sheet2[Voucher Date Time] )
        )
    )
)

Capture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-juanli-msft 

 

This also worked perfectly as a measure.

amitchandak
Super User
Super User

create a new column like one given below

countx(filter(table,table[File Number] = earlier(table[File Number]) && table[Voucher Type] ="IN" && earlier(table[Voucher Type])="IN"
&& table[Voucher Date Time]<=earlier(table[Voucher Date Time])),table[File Number])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

@amitchandak 

 

Worked perfectly!!!  Thank you!!!

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.