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

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

Reply
alex_yk_yeung
New Member

Using DAX to return a specific value when metric in another colume reached certain value

Dear all

 

I am trying to use DAX language to return the time of in the day which the total stock sold has reached or higher than stock_in (stock received) [i.e. the metric"%Sold_over_Recd" is 1 or above], in the below example, I wish to return "1:00:00PM" as the return value.

 

Would love to learn your advice on how this could be achieved with the use of the DAX language, thank you very much in advance!

 

Screenshot 2024-06-19 120036.png

 

If need any further clarification on the above question, please feel free to let me know, cheers.

1 ACCEPTED SOLUTION
aduguid
Super User
Super User

FirstMinimumDateTimeWherePercentageIsOneOrMore = 
CALCULATE(
    MINX(
        FILTER(
            ADDCOLUMNS(
                'Table',
                "PercentageMeasure", [Percentage]
            ),
            [PercentageMeasure] >= 0.01
        ),
        'Table'[DateTime]
    )
)

View solution in original post

2 REPLIES 2
alex_yk_yeung
New Member

It works! Thank you very much aduguid !

 

Now I am able to identify the earliest time when stock is went out, thanks again!


Screenshot 2024-06-19 144135.png

aduguid
Super User
Super User

FirstMinimumDateTimeWherePercentageIsOneOrMore = 
CALCULATE(
    MINX(
        FILTER(
            ADDCOLUMNS(
                'Table',
                "PercentageMeasure", [Percentage]
            ),
            [PercentageMeasure] >= 0.01
        ),
        'Table'[DateTime]
    )
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.