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
KasperJ90
Helper III
Helper III

Measure if qty between interval and other column criteria true

Hi

 

I have to create 3 measures based on intervals from the "Difference in days" column and if the column "Our Mistake" equals "No".

 

Measure1: sum Qty if "Difference in days" => 0 and <8 and "Our Mistake?" = "No"

Measure2:sum Qty if "Difference in days" =>8 and <21 and "Our Mistake?" = "No"

Measure3:sum Qty if "Difference in days" => 21 and <200 and "Our Mistake?" = "No"

 

QtyDifference in daysOur Mistake?
3005Yes
150040No

 

Can you help me do the correct formulas for creating the measueres in PowerBi?

 

Thanks

1 REPLY 1
Fowmy
Super User
Super User

@KasperJ90

Add the following three measures

Measure1 = 
SUMX(
    FILTER(Table6, Table6[Difference in days] >= 0 &&   Table6[Difference in days] < 8 && Table6[Our Mistake?] = "No"),
    Table6[Qty] 
)

Measure2 = 

SUMX(
    FILTER(Table6, Table6[Difference in days] >= 8 &&   Table6[Difference in days] < 21 && Table6[Our Mistake?] = "No"),
    Table6[Qty] 
)

Measure3 = 

SUMX(
    FILTER(Table6, Table6[Difference in days] >= 21 &&   Table6[Difference in days] < 200 && Table6[Our Mistake?] = "No"),
    Table6[Qty] 
)

________________________

If my answer was helpful, consider Accepting it as the solution to help other members find it

Click the Thumbs-Up icon if you like this answer 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
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.