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

CALCULATE used in True/False expression?

I have used the following to calculate the lower quartile upper value.

 

Percentile = CALCULATE(PERCENTILE.INC(Table1[Ordinary Pay (in the month of April)],0.25),Table1[Ordinary Pay (in the month of April)]<>0,Table1[Ordinary Pay (in the month of April)]<>Blank())
 
It returns a number.
 
The next calculates the amount of values less than 1000.
 
Measure = Calculate(Count(Table1[Ordinary Pay (in the month of April)]),Table1[Ordinary Pay (in the month of April)]<1000)
 
This also returns a number.
 
However, when I join them together by replacing the 1000 with the quartile calculation, I get an error.
 
Measure = Calculate(Count(Table1[Ordinary Pay (in the month of April)]),Table1[Ordinary Pay (in the month of April)]<(CALCULATE(PERCENTILE.INC(Table1[Ordinary Pay (in the month of April)],0.25),Table1[Ordinary Pay (in the month of April)]<>0,Table1[Ordinary Pay (in the month of April)]<>Blank())))
 
Returns an error.
 
Why?
 
 
1 REPLY 1
tamerj1
Super User
Super User

Hi @pinkdoughnut11 
Please try

Measur =
VAR X =
    CALCULATE (
        PERCENTILE.INC ( Table1[Ordinary Pay (in the month of April)], 0.25 ),
        Table1[Ordinary Pay (in the month of April)] <> 0,
        Table1[Ordinary Pay (in the month of April)] <> BLANK ()
    )
RETURN
    CALCULATE (
        COUNT ( Table1[Ordinary Pay (in the month of April)] ),
        Table1[Ordinary Pay (in the month of April)] < X
    )

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.

Top Solution Authors