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

Sales Revenue Segmentation Drill Through

I am working with a composite model that is providing sales information at an aggregated level which the business would like to drill through to see detailed information. The aggregate sums sales by the parent client to place the entire "client" in a segment bucket. The drill through needs to show the individual clients that make up the parent totals.

In this snapshot, let's focus on the >200k segment. You can see that when sales is summed by parent code, there is $5.4M in sales and 8 parent clients. 

Swish11_1-1635884365692.png

 

Total Sales =
TRUNC(CALCULATE(
[Adjusted Sales],
FILTER(
VALUES( 'Accounts'[Parent Client Code] ),
COUNTROWS(
FILTER( 'Revenue Segments',
AND(
[Adjusted Sales Revenue] >='Revenue Segments'[Start],
[Adjusted Sales Revenue] <='Revenue Segments'[End]
) )
) > 0
) ) )

 

Total Client Count Segment_C =
CALCULATE(
[Total Parent Code Count],
FILTER(
VALUES('Accounts'[Parent Client Code] ),
COUNTROWS(
FILTER( 'Revenue Segments',
AND(
[Adjusted Sales Revenue] >='Revenue Segments'[Start],
[Adjusted Sales Revenue] <='Revenue Segments'[End]
))) > 0
))

 

[Adjusted Sales Revenue] is a measure from my tabular model.

 

The numbers on the matrix are verified. The conundrum I now face is when I drill through to the detail, I am missing records. The matrix is applying the >200k segment to each child row, which drops two of the eight clients because the child clients do not have <200k in sales.

Swish11_2-1635884655839.png

When the drill through happens, I need the segment row filter >200k dropped so all children with parents that are counted in the eight total records are displayed.

 

Missing records:

ParentIDClientIDSalesRevenue
474036162724443,225
4740361627244166,542
292044256536288,535
2920442565362195,107

 

I am unable to share the pbix file due to the sensitive nature of the information.

1 ACCEPTED SOLUTION
Swish11
Frequent Visitor

I ended up having to hard-code the segments in the model for this to work. Power BI would not retain the correct filter context to allow for drill through.

View solution in original post

5 REPLIES 5
Swish11
Frequent Visitor

I ended up having to hard-code the segments in the model for this to work. Power BI would not retain the correct filter context to allow for drill through.

v-yangliu-msft
Community Support
Community Support

Hi  @Swish11 ,

According to the official Microsoft article description:

Report interactions will execute DAX queries. Each DAX query consumes a certain amount of temporary memory required to produce the results. Each query may consume a different amount of memory and will be subject to the query memory limitation as described.

Configure workloads

Maximize your capacity's available resources by enabling workloads only if they will be used. Change memory and other settings only when you have determined default settings are not meeting your capacity resource requirements.

To configure workloads in the Power BI admin portal

  1. In Capacity settings > PREMIUM CAPACITIES, select a capacity.
  2. Under MORE OPTIONS, expand Workloads.
  3. Enable one or more workloads, and set a value for Max Memory and other settings.
  4. Select Apply.

Refer:https://blog.crossjoin.co.uk/2020/01/20/visual-has-exceeded-the-available-resources-error-power-bi/ 

You can try to change the function to this form:

Add the all() function:

Total Client Count Segment_C =
CALCULATE(
[Total Parent Code Count],
FILTER(
VALUES('Accounts'[Parent Client Code] ),
COUNTROWS(
FILTER( ALL('Revenue Segments'),
AND(
[Adjusted Sales Revenue] >='Revenue Segments'[Start],
[Adjusted Sales Revenue] <='Revenue Segments'[End]
))) > 0
))

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Unfortunately, using ALL('Revenue Segments') returns the total sales on all rows of the matrix, ignoring the start and end requirements for the segment value.

amitchandak
Super User
Super User

@Swish11 , Change the filter measure like

 

CALCULATE(
[Total Parent Code Count],
FILTER(
VALUES('Accounts'[Parent Client Code] ),
calculate(COUNTROWS(
FILTER( 'Revenue Segments',
AND(
[Adjusted Sales Revenue] >='Revenue Segments'[Start],
[Adjusted Sales Revenue] <='Revenue Segments'[End]
))) , filter(allselected('Accounts') , 'Accounts'[Parent Client Code] = max('Accounts'[Parent Client Code]))) > 0
))

I made this modification and am now getting this error message.

Swish11_0-1635943374189.png

 

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.