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
Anonymous
Not applicable

COUNTIFS on top of another calculation

Hi,

I've looked through all the countif solutions here, but my issue seems a bit different.

 

Basically the spreadsheet report has a pivot table on top of a data set. The Pivot is Name and Max(Frequency)

The Countif references that table and puts the frequencies into buckets: 1,2,3,4,5+.

In SQL I would have solved this issue with a dense rank with over (partition by).

 

The issue I have is that my count is counting underlying rows in the data table, instead of counting at face value.

How do I ignore underlying transactions?

 

I'm using the following calc for #/bucket:

#/bucket = COUNTAX('DAILY SALES',
CALCULATE (
MAXA('DAILY SALES'[Frequency Factor Bucket]),
FILTER (
'DAILY SALES',
'DAILY SALES'[Frequency Factor Bucket] = EARLIER('DAILY SALES'[Frequency Factor Bucket] )
)
)
)

Below I have the frequency I want to count, my current result in yellow, and the result I want in orange.

The current calc in yellow is counting all the underlying transactions too.

Capture.PNG

Thanks in advance!

Basia

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi All, 

I have solved the issue myself.

It was mainly to do with context and my misunderstanding of it.

 

Solution is:

COUNTAX (
ALLSELECTED (Adviser[Adviser Name] ),
CALCULATE ( COUNTA (Sales[Frequency Factor Bucket]) )
)

 

Basia

View solution in original post

12 REPLIES 12

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.