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
bradlee
New Member

Computed total based on measures does not respect page filters

I am reporting on subscriptions.  The data is organized in a parent/child relationship.   The parent is a Summary table, with the children as Orders.  The key between the tables is the date.

Originally, this reported static results by date with no filters.  The summary data came pre-computed from SQL Server.  Now I want to allow the user the ability to select various filters.  I'm changing the PowerBI report to support this new requirement.  The data looks like this:

bradlee_0-1603215784365.png

 

A relationship is setup between the two tables.  This is pretty much what the report looks like also, except with date drill down enabled.  I've defined a few measures in the parent Summary table as follows:

 

Measures
ComputeNew = CALCULATE(count('Detail'[OrderNo]), 'Detail'[TransactionType] = "N")
ComputeRenew = CALCULATE(count('Detail'[OrderNo]), 'Detail'[TransactionType] = "R")
ComputeCancelled = CALCULATE(count('Detail'[OrderNo]), 'Detail'[TransactionType] = "C")

These work fine and provide the correct numbers as the report is filterd.  However, for the "Expired" column, I need to look for last year's subscriptions that expire on the specific date.  As far as I can tell, I cannot do this with a measure.  I created a computed column in the summary table as follows:

 

ComputeExpired = 
var CurrentDate = 'Summary'[Date]
return COUNTX(
FILTER('Detail',
'Detail'[RenewalDate] = CurrentDate
&& 'BI PIFDetailPsdn'[TransactionType] IN {"N", "R"}
),
'Detail'[OrderNo]
)

 

Again, this produces the expected results.  The problem I am running into is when creating a Computed Total column.  The computed total is defined as:

 

Total = [ComputedNew] + [ComputedRenew] - [ComputedCancelled] - [ComputedExpired]

 

The total is correct as long as no other filters are active.  If a filter is active for the subscriptions table, the total ignores that filter.  It does not add up the value of the filtered measures.

2 REPLIES 2
bradlee
New Member

After more investigation, the computed total column does not respect the page filters.  For example, if the subscriptions are filtered by a category, the summary measures update with the correct totals.  However, the computed total shows the total of unfiltered results.  This seems to be a bug in PowerBI.

Hi @bradlee ,

Based on your description, seems like there are more than three tables in your dataset which have been quoted in the measure formula.

If it is just calculation issue, not think it could be an bug in power bi, could you please sharing more details like some sanple data and expected output for further discussion?

 

Best Regards,

Yingjie Li

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.