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
powerBIpeon
Helper II
Helper II

Calculate Quartiles based on filters/criterias

I want to only calculate the quartiles if the account meets the criteria below.

 

  • Account is at 100 to 1,000 users
  • Revenue is between $0 and $100,000

 

I'm currently using this calculated column, but it is calculating all of the data set rather then just the critera above. I tried including additional filters to the formula, but the results are the same. Should use a different approach?

 

Quartile = 
var low = PERCENTILEX.INC(
     Filter(
            'Assets',
            ISBLANK('Assets'[Revenue]) = FALSE()),
    ),
    'Assets'[Revenue], 0.25
)
var mid = PERCENTILEX.INC(
     Filter(
            'Assets',
            ISBLANK('Assets'[Revenue]) = FALSE()),
    ),
    'Assets'[Revenue], 0.5
)
var high = PERCENTILEX.INC(
     Filter(
             'Assets',
            ISBLANK('Assets'[Revenue]) = FALSE()),
    ),
    'Assets'[Revenue], 0.75
)
Return 
IF([Revenue] <= low, 1, IF([Revenue] <= mid, 2, IF([Revenue] <= high, 3, 4)))

 

 

1 ACCEPTED SOLUTION

Hi @powerBIpeon,

 

I went through the file again. I did the following.

 

1.  I created filters on table Assets for User Band and Revenue as per your criteria in the calculated column Quartile computation.

2.  Then in the table output to show Quartile and Revenue,

         a )I changed Revenue not to be summarized.

         What this means is that it shows which quartile each revenue value belongs to.  In your original

           table it was showing the sum of revenue column under a quartile.

        b) Also set the Revenue in the Visual filter to less than 100,000.

        c) Added USerBand in the Visual filter and set it to  1 to 1000. This will elimnate showing  other values in the userband.

 

3. I also created a disconnected table Quartile with values as 1 to 4.

4. created a measure called ShowValue . please go through it.

5. Created a table visual with values as Quartile from Quartile table and ShowValue as values.

 

I have attached the pbix file for your reference.

 

Let me know if this works.

 

Cheers

 

CheenuSing

 

3. I created the Quartile measures - Quartile0 to Quartile 4 and plotted them on a card visual.

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
CheenuSing
Community Champion
Community Champion

Hi @powerBIpeon 

 

You will have to filter the table for the criteria and then on the filtered set compute.

 

Please share some data and the expected output.

 

Cheers

 

CheenuSing

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

@CheenuSing 

 

Results:

Q0 = $37,800

Q1 = $39,476.56

Q2 = $42,857.25

Q3 = $60,179.09

Q4 = $79,704.00

 

Link to data table: 

https://www.dropbox.com/s/qytdjahgwnakfak/quartileexample.pbix?dl=0

 

Thank you in advance!

Hi @powerBIpeon,

 

I went through the file again. I did the following.

 

1.  I created filters on table Assets for User Band and Revenue as per your criteria in the calculated column Quartile computation.

2.  Then in the table output to show Quartile and Revenue,

         a )I changed Revenue not to be summarized.

         What this means is that it shows which quartile each revenue value belongs to.  In your original

           table it was showing the sum of revenue column under a quartile.

        b) Also set the Revenue in the Visual filter to less than 100,000.

        c) Added USerBand in the Visual filter and set it to  1 to 1000. This will elimnate showing  other values in the userband.

 

3. I also created a disconnected table Quartile with values as 1 to 4.

4. created a measure called ShowValue . please go through it.

5. Created a table visual with values as Quartile from Quartile table and ShowValue as values.

 

I have attached the pbix file for your reference.

 

Let me know if this works.

 

Cheers

 

CheenuSing

 

3. I created the Quartile measures - Quartile0 to Quartile 4 and plotted them on a card visual.

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

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.