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
CESARPULIDOGDL
Frequent Visitor

MAX DAY PER MONTH WITH A CONDITIONAL

Hi

Thanks for read me, i have a trouble, i need a add a column, that shows the max of the workday (column b) by month, but also have t condition working (columE).

 

thanks

 

CESARPULIDOGDL_1-1681446451271.png

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @CESARPULIDOGDL 

try like:

Column = 
MAXX(
    FILTER(
        TableName,
        FORMAT(TableName[Fecha], "yyyymm")=FORMAT(EARLIER(TableName[Fecha]), "yyyymm")
        &&TableName[IsWorkingday]="working"
    ),
    DAY(TableName[Fecha])
)

or

Column2 = 
MAXX(
    FILTER(
        TableName,
        EOMONTH(TableName[Fecha],0)=EOMONTH(EARLIER(TableName[Fecha]),0)
        &&TableName[IsWorkingday]="working"
    ),
    DAY(TableName[Fecha])
)

 

FreemanZ_3-1681468765499.png

it makes more sense to do with a measure.

View solution in original post

2 REPLIES 2
CESARPULIDOGDL
Frequent Visitor

@FreemanZ  thank you, its works..

 

FreemanZ
Super User
Super User

hi @CESARPULIDOGDL 

try like:

Column = 
MAXX(
    FILTER(
        TableName,
        FORMAT(TableName[Fecha], "yyyymm")=FORMAT(EARLIER(TableName[Fecha]), "yyyymm")
        &&TableName[IsWorkingday]="working"
    ),
    DAY(TableName[Fecha])
)

or

Column2 = 
MAXX(
    FILTER(
        TableName,
        EOMONTH(TableName[Fecha],0)=EOMONTH(EARLIER(TableName[Fecha]),0)
        &&TableName[IsWorkingday]="working"
    ),
    DAY(TableName[Fecha])
)

 

FreemanZ_3-1681468765499.png

it makes more sense to do with a measure.

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.