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
LilianaAcosta33
Frequent Visitor

How to get the number of days until a percentage is met

Hi, 

I have been tasked to calculate the number of days it takes to meet a certain percentage. The user can select the start date using a slicer. 

 

I have the following data:

In this example, let's say that we want to calculate the number of days it took to hit 4% since the first date, which in this case is 1/1/2018. The result should be 9 days (from 1/1/2018 to 1/10/2018).

 

LilianaAcosta33_0-1674690655158.png

 

Is there a way this calculation can be made?

 

1 ACCEPTED SOLUTION
grantsamborn
Solution Sage
Solution Sage

Hi @LilianaAcosta33 

Does this help?  (Note that [Characteristice Life] is a measure.)

 

# of Days = 
    COUNTROWS(
        FILTER(
            ADDCOLUMNS(
                VALUES( 'Table'[Date] ),
                "_tmp", [Characteristic Life]
            ),
            [_tmp] <= .04
        )
    )

 

 

pbix: https://1drv.ms/u/s!AnF6rI36HAVkhPIr8MyQISWOyMDXdQ?e=CADtSy

 

View solution in original post

2 REPLIES 2
LilianaAcosta33
Frequent Visitor

Just what I needed! thank you so much @grantsamborn 

grantsamborn
Solution Sage
Solution Sage

Hi @LilianaAcosta33 

Does this help?  (Note that [Characteristice Life] is a measure.)

 

# of Days = 
    COUNTROWS(
        FILTER(
            ADDCOLUMNS(
                VALUES( 'Table'[Date] ),
                "_tmp", [Characteristic Life]
            ),
            [_tmp] <= .04
        )
    )

 

 

pbix: https://1drv.ms/u/s!AnF6rI36HAVkhPIr8MyQISWOyMDXdQ?e=CADtSy

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.