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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Cristina893
Regular Visitor

Group a column status with text by Month (group a conditional column)

Hi,

 

I have a table with invoice status by week, I want to get the Invoice status by month.

If any week within a month have the "Invoice Week Status" Not Approved than all the rows in the column "Invoice Status by Month" shoud be Not Approved.

pictur.png

 

Thanks a mil!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Cristina893 , Try a new column like

 

if(isblank(countx(filter(table, [month] =earlier([Month]) && [Invoice Status by week] = "Not Approved"),[Invoice Status by week])),"Approved", "Not Approved")

 

if needed add

 

&& [Invoice_no] =earlier([Invoice_no])

View solution in original post

v-yangliu-msft
Community Support
Community Support

Hi  @Cristina893  ,

I created some data:

v-yangliu-msft_0-1612744529784.png

Here are the steps you can follow:

1. Create calculated column.

Invoice Status by Month = IF(
 "Not Approved" in SELECTCOLUMNS(FILTER('Table',[Year+Month]=EARLIER('Table'[Year+Month])),"1",[invoice Status by week]),
    "Not Approved","Invoice Approved")

2. Result.

v-yangliu-msft_1-1612744529791.jpeg

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Cristina893  ,

I created some data:

v-yangliu-msft_0-1612744529784.png

Here are the steps you can follow:

1. Create calculated column.

Invoice Status by Month = IF(
 "Not Approved" in SELECTCOLUMNS(FILTER('Table',[Year+Month]=EARLIER('Table'[Year+Month])),"1",[invoice Status by week]),
    "Not Approved","Invoice Approved")

2. Result.

v-yangliu-msft_1-1612744529791.jpeg

 

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Cristina893 , Try a new column like

 

if(isblank(countx(filter(table, [month] =earlier([Month]) && [Invoice Status by week] = "Not Approved"),[Invoice Status by week])),"Approved", "Not Approved")

 

if needed add

 

&& [Invoice_no] =earlier([Invoice_no])

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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