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.
Hi All, I have category wise, sub category wise and customer wise data. Now I want to compare % share at levels.
My requirement is when it's category it compare the total but when it is subcategory or customer it compares to it's parent category only like below :
Link for sample excel file :
Solved! Go to Solution.
Hi @DeepDive ,
I used part your data to create a sample .pbix file,see below:
Create a measure as below:
Share% =
var _sharetotal=DIVIDE(CALCULATE(SUM('Sales'[Qty]),FILTER(ALL('Sales'),'Sales'[Category]=MAX('Sales'[Category]))),CALCULATE(SUM('Sales'[Qty]),ALL('Sales')))
var _sharesubtotal=DIVIDE(CALCULATE(SUM('Sales'[Qty])),CALCULATE(SUM('Sales'[Qty]),FILTER(ALL('Sales'),'Sales'[Category]=MAX('Sales'[Category]))))
Return
IF(ISINSCOPE('Sales'[Sub Category]),_sharesubtotal,IF(ISINSCOPE('Sales'[Category]),_sharetotal,BLANK()))
And you will see:
For details,pls see attached.
Hi @DeepDive ,
I used part your data to create a sample .pbix file,see below:
Create a measure as below:
Share% =
var _sharetotal=DIVIDE(CALCULATE(SUM('Sales'[Qty]),FILTER(ALL('Sales'),'Sales'[Category]=MAX('Sales'[Category]))),CALCULATE(SUM('Sales'[Qty]),ALL('Sales')))
var _sharesubtotal=DIVIDE(CALCULATE(SUM('Sales'[Qty])),CALCULATE(SUM('Sales'[Qty]),FILTER(ALL('Sales'),'Sales'[Category]=MAX('Sales'[Category]))))
Return
IF(ISINSCOPE('Sales'[Sub Category]),_sharesubtotal,IF(ISINSCOPE('Sales'[Category]),_sharetotal,BLANK()))
And you will see:
For details,pls see attached.
@DeepDive , Try like
divide(calculate(Sum(Table[Total])),calculate(count(Table[Total]), allexcept(Table[Category])))
this dax not giving me correct figures.
Hi @amitchandak , I think there is some typo error in your dax ("Count"),
am using this below :
@DeepDive , Try like
Measure = divide([Total],calculate([Total], allexcept('Product','Product'[Category],'Product'[Sub Category]), allexcept('Customer','Customer'[Customer])))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |