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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Stuznet
Helper V
Helper V

Divide With 2 filters Measure

 

On an Excel I created a matrix for Late and On-Time is based on Status 2 Column. I want to know how to divide column "=C/D" with a Status text filter "Late" and "On-Time"? Column E is what I'm looking for is the percentage. 

 2018-09-08_9-33-00.png

I created a measure 

Measure= DIVIDE(SUM(Data[ID]), SUM(Data[Status2]), FILTER(Data,Data[Status2] = "Late" && Data[Status2]="On-Time"))

 

but I'm getting an error 

2018-09-08_9-30-42.png

 

Then I tried this formula 

Measure2 = DIVIDE(CALCULATE(SUM(Data[ID]),Data[Status2]="Late"),CALCULATE(SUM(Data[ID]),Data[Status2] = "On-Time"))

 

I got this error

Capture.PNG

 

What am I doing wrong here?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Stuznet,

 

You second measure is correct however you need to do a count your ID column is type text and you cannot sum text fields.

 

Measure2 =
DIVIDE (
    CALCULATE ( COUNT ( Data[ID] ), Data[Status2] = "Late" ),
    CALCULATE ( COUNT ( Data[ID] ), Data[Status2] = "On-Time" )
)

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @Stuznet,

 

You second measure is correct however you need to do a count your ID column is type text and you cannot sum text fields.

 

Measure2 =
DIVIDE (
    CALCULATE ( COUNT ( Data[ID] ), Data[Status2] = "Late" ),
    CALCULATE ( COUNT ( Data[ID] ), Data[Status2] = "On-Time" )
)

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you so much it worked I just need to change the whole number to Percentage. 🙂 

Select the measure and on the modeling tab select the %.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.