cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to find the Min by Month and Year

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
Highlighted
Super User VII
Super User VII

Re: How to find the Min by Month and Year

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






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.





Highlighted
Anonymous
Not applicable

Re: How to find the Min by Month and Year

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

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

Highlighted
Community Support
Community Support

Re: How to find the Min by Month and Year

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors