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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors