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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hhasmin
Frequent Visitor

Percentage of 2 columns - HELP!

Hi!

 

I am very new to power BI and I am currently creating a report.

So I have a table that has list of employees, their cases, date case opened and date case closed. I need the percentages of the non past due cases (meaning cases > 4 days). I was able to create another column (conditional) which will determine whether a case is Past Due or not. PastDue column will give me only Yes or No. 

PastDue = if ('Case Record Type'[CycleTime]>4,"Yes","No" )

 

Then I created another column for CycleTime. This will count how many days the case has been opened.

CycleTime = DATEDIFF('Case record Type'[Date/Time Opened],'Case record Type'[Date/Time Closed],day)

 

Now I created a Matrix where I can pivot these columns. 

 

I Included Employee name, Past Due (will show Yes and No column) and Cycle time.

 

case.JPG

 

Now my problem is I need to get the percentages of the non past due cases (those that are No in the Past Due Column).

 

I want to use the formula (No/Total)*100  

 

I hope you can help me. In excel it is very easy but in here I've been trying to do it but I cant seem to find a way.

5 REPLIES 5
v-cherch-msft
Employee
Employee

Hi @hhasmin

 

It's better to share your simplified data sample and expected output. You can upload it to OneDrive or Dropbox and post the link here.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-cherch-msft
Employee
Employee

Hi @hhasmin

 

 You may try to create a measure as below:

 

Measure =
VAR Total =
    CALCULATE ( SUM ( Table[Cycle Time] ), ALL ( Table[PastDue] ) )
VAR No =
    CALCULATE ( SUM ( Table[Cycle Time] ), FILTER ( Table, Table[PastDue] = "No" ) )
RETURN
    DIVIDE ( No, Total ) * 100

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-cherch-msft! I can try that, but how can I include that as a column? can i add measure as a column?

Hi @hhasmin

 

You may also create a column as below:

Column =
IF (
    Table4[PastDue] = "No",
    DIVIDE (
        SUMX ( FILTER ( Table, Table[PastDue] = "No" ), Table[CycleTIme] ),
        SUM ( Table[CycleTIme] )
    )
        * 100
)

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-cherch-msft i tried it however it is not giving me percentages of No. I am not sure what i am doing wrong 😞

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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