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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Kayla2020
Frequent Visitor

Generate percentage from totals

Hi all,

I have a table visual where I created a datediff measure for Day 1 and Day 2 across various projects.

Day 1 measure =
VAR Day1 = SUMX(Sheet1,
IF(ISBLANK(Sheet1[Day 1]),BLANK(),
IF(
    ISBLANK(RELATED('Sheet1 (2)'[Day 1])),
    DATEDIFF(TODAY(), Sheet1[Day 1],DAY),
    DATEDIFF(RELATED('Sheet1 (2)'[Day 1]), Sheet1[Day 1],DAY)
)
)
)
Return
IF(
    ISBLANK(Day1),
    BLANK(),
    IF(
        Day1<=7,
        "<7d",
        IF(
            Day1 > 7 && Day1<=14,
            "<14d",
            ">14d"
        )))


I would like to calculate the achievement rate in percent for Day 1 and Day 2. i.e, I would like to translate these totals from >7days, <7days & >14days to percentage. For instance, if the total duration for all projects on Day 1 is less than 7 days, the achievement rate should be 100%.

Please how do I achieve this?

Please find the image below 

Thank you.

Kayla2020_0-1684909566009.png

 

 

 

1 REPLY 1
vk_pbi
Resolver II
Resolver II

Hi

Not sure about your entire calculation, I just created a table and apply the below measure

t1 = 
SWITCH(
    TRUE(),
    SELECTEDVALUE(Test[Day1]) = "<7d",1,
    SELECTEDVALUE(Test[Day1]) = ">14d", 0.5,
    BLANK()
)

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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