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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jorritster
Frequent Visitor

Measure that displays month when value for column X changed

Hi all,

 

I am trying to create a seemingly easy measure in Power Bi.  I have a year, month and a binary variable called Threshold_Passed. I  want to create a measure that contains the month in which the Threshold_Passed measure changed from False to True, because only in that month I need to check it. If it is True again in April, I can assume it has already been checked last month.

 

It can also happen that in the first month of the year the Threshold_Passed measure is already True. In that case the Month_Threshold_Passed should be January. Once the Threshold_Passed variable has a True, it can never go back to false within the same year.

 

YearMonthThreshold_PassedMonth_Threshold_Passed
2022JanuaryFalse 
2022FebruaryFalse 
2022MarchTrueMarch
2022AprilTrueMarch

 

Any help is appreciated. Let me know if you need any more information.

 

Kind regards, Jorrit

 

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

Hi @Jorritster ,

According to your description, I download your sample, here's my solution.

Create a measure,

Month_Threshold_Passed =
VAR _MIN =
    MINX (
        FILTER (
            ALL ( 'Table' ),
            YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) )
                && 'Table'[Threshold_Passed] = "True"
        ),
        'Table'[Date]
    )
RETURN
    IF (
        MONTH ( MAX ( 'Table'[Date] ) ) < MONTH ( _MIN )
            || NOT ( ISINSCOPE ( 'Table'[Customer] ) ),
        BLANK (),
        FORMAT ( _MIN, "MMMM" )
    )

Get the result.

vkalyjmsft_0-1655864578535.png

I attach my sample for reference.

 

Best Regards,
Community Support Team _ kalyj

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

5 REPLIES 5
lbendlin
Super User
Super User

You can use MIN() or FIRSTNONBLANK() or many other approaches for this.

 

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Hi Ibendlin,

 

Thank you for your response. 

 

As the data is confidential I did not add it initially. However, I have created some dummy data based on manual entry that covers an example. I have not included the model as I am using a lot of different sources:

https://www.dropbox.com/s/sxt9vju0xkhbn5t/Dummy_Threshold_Management.pbix?dl=0

 

To give you some more perspective (in the actual model): 

- YTD_TaxableBasis is a YTD calculation of Monthly TaxableBasis.

- Threshold is coming from a different table (each country has a different threshold).

- Threshold_Passed equals True if YTD_TaxableBasis > Threshold.

 

Goal: create an indicator (Month_Threshold_Passed) to know when the threshold was passed. 

 

Expected output:

Jorritster_0-1655711995468.png

 

Hope this helps, Jorrit

v-yanjiang-msft
Community Support
Community Support

Hi @Jorritster ,

According to your description, I download your sample, here's my solution.

Create a measure,

Month_Threshold_Passed =
VAR _MIN =
    MINX (
        FILTER (
            ALL ( 'Table' ),
            YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) )
                && 'Table'[Threshold_Passed] = "True"
        ),
        'Table'[Date]
    )
RETURN
    IF (
        MONTH ( MAX ( 'Table'[Date] ) ) < MONTH ( _MIN )
            || NOT ( ISINSCOPE ( 'Table'[Customer] ) ),
        BLANK (),
        FORMAT ( _MIN, "MMMM" )
    )

Get the result.

vkalyjmsft_0-1655864578535.png

I attach my sample for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

Hi @v-yanjiang-msft,

 

Your a hero. Thanks for your help. ๐Ÿ™‚

 

I have accepted your post as a solution. Cheers!

Hi @v-yanjiang-msft, one additional question. Ideally, for my dashboard I want the user to be able to filter with a slicer on the Month_Threshold_Passed. After Googling I found out that I need to create a column for this. However, if I use the same code it does not understand the relationships. This is my model:

 

Jorritster_0-1656316307801.png

How can I include related(table) in the code to make it work for a column? I have a bridge direction table because otherwise I have a many-to-many relationship. 

 

Hope you can help ๐Ÿ™‚

 

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)