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
Anonymous
Not applicable

How to find the Min by Month and Year

I am trying to find the Min Seq number by Month and Year.

Below I have a Matrix where I am finding the Min Sequence Number which is working at the monthly level.

For the month of Feb I want to see a Total of 6 which is correct. Also the Min for March is 8 which is also correct. 

 

However, I am also looking for the Min for the whole year while still showing the Months.

Below, I have a Min of 6 for the year. I would like to only see 6 and not see 8 when I expand for 2019

 

I tried to find the Min of total with no success. 

 

PBI Min.PNG

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Table:

e1.png

 

You may create a measure and a calculated column as follows.

 

calculated column:
Month Year = FORMAT('Table'[FROM_FILL_DATE],"mmm-yyyy")

Measure:
Min_Lead_Email = 
IF(
    ISINSCOPE('Table'[FROM_FILL_DATE].[Month]),
    CALCULATE(
            MIN('Table'[Value_Lead_Email]),
            FILTER(
                ALLSELECTED('Table'),
                MONTH('Table'[FROM_FILL_DATE]) = MONTH(MAX('Table'[FROM_FILL_DATE]))&&
                YEAR('Table'[FROM_FILL_DATE]) = YEAR(MAX('Table'[FROM_FILL_DATE]))
            )
    ),
    CALCULATE(
        MIN('Table'[Value_Lead_Email]),
        FILTER(
            ALLSELECTED('Table'),
            YEAR('Table'[FROM_FILL_DATE]) = YEAR(MAX('Table'[FROM_FILL_DATE]))
        )
    )
)

 

 

Result:

e2.png

e3.png

 

Best Regards

Allan

 

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

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Table:

e1.png

 

You may create a measure and a calculated column as follows.

 

calculated column:
Month Year = FORMAT('Table'[FROM_FILL_DATE],"mmm-yyyy")

Measure:
Min_Lead_Email = 
IF(
    ISINSCOPE('Table'[FROM_FILL_DATE].[Month]),
    CALCULATE(
            MIN('Table'[Value_Lead_Email]),
            FILTER(
                ALLSELECTED('Table'),
                MONTH('Table'[FROM_FILL_DATE]) = MONTH(MAX('Table'[FROM_FILL_DATE]))&&
                YEAR('Table'[FROM_FILL_DATE]) = YEAR(MAX('Table'[FROM_FILL_DATE]))
            )
    ),
    CALCULATE(
        MIN('Table'[Value_Lead_Email]),
        FILTER(
            ALLSELECTED('Table'),
            YEAR('Table'[FROM_FILL_DATE]) = YEAR(MAX('Table'[FROM_FILL_DATE]))
        )
    )
)

 

 

Result:

e2.png

e3.png

 

Best Regards

Allan

 

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

parry2k
Super User
Super User

@Anonymous share some sample data and will get you the solution.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I sent you a sample pbix file. Having challenges posting here.

This is a screen shot of what was sent. PBI Help.PNG

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.

Top Solution Authors