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
mg01
Helper I
Helper I

Need % for each subcategory with category with respect to total purchased subcategory.

Hi Team,

Below is screenshot for data output the same output I need to replicate in Power BI matrix:

mg01_0-1674215991042.png


I need to calculate the last % value, For Ex. For ALL ITEMS Category, we have Branch Stocked Subcategory 
The Unique Items value is 524
And Total Purchased Subcategory within ALL ITEMS Category the Unique Item value is 1328
% value of Branch Stocked = 524/1328=39.5%, Same type of calculation we need for all subcategory within a category.

Power BI Screenshot:

mg01_1-1674216283135.png

 What measure I need to create to get similar output in Power BI?

Thanks in advance!




2 REPLIES 2
Mahesh0016
Super User
Super User

@mg01 

% value of Branch Stocked =

VAR Sub_ListPrice = CALCULATE(MAXX(ALLSELECTED(TrainingSample2[Business Segment]),[Total ListPrice]))

RETURN
DIVIDE([Total ListPrice],[Sub_ListPrice],0)
 
 
#Sub_ListPrice
Sub_ListPrice = CALCULATE(MAXX(ALLSELECTED(TrainingSample2[Business Segment]),[Total ListPrice]))



Mahesh0016_0-1674221108684.png

@mg01 If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.

I tried first this measure :

sub1 category = CALCULATE(MAXX(ALLSELECTED('Total Purchased'[Sub Category]),COUNT('Total Purchased'[Column])))

where
Unique Items= COUNT('Total Purchased'[Column])

But not getting correct result.

mg01_0-1674473665321.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.