The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
i want to divide each row of TY_Actual with its subtotal i.e 110679.54 to get the %. i created 1 measure and it was showing correct value but the catch was the value was getting displayed in total row rest rows were empty
Solved! Go to Solution.
Hi, @Anonymous
sorry, in above code there are some changes needed and i forgot to write it
try below code
result =
var a = sum('yourtablename'[TY_Actual])
var b = calculate ( sum('yourtablename'[TY_Actual],
removefilters('yourtablename')
)
return
divide(a,b)
if it not work then provide some sample data
Hi, @Anonymous
try below code
just adjust your table and column name
result =
var a = sum('yourtablename'[TY_Actual])
var b = calculate ( sum('yourtablename'[TY_Actual],
removefilters('yourtablename')
)
return
divide (a,b)
not working
Hi, @Anonymous
sorry, in above code there are some changes needed and i forgot to write it
try below code
result =
var a = sum('yourtablename'[TY_Actual])
var b = calculate ( sum('yourtablename'[TY_Actual],
removefilters('yourtablename')
)
return
divide(a,b)
if it not work then provide some sample data
Thank You so much....
Hello @Anonymous ,
Could you give more info on the measure you tried ?
In a first look, I could suggest in your measure to calculate the SUM of TY_Actual filtering by DayPart, and to calculate the same SUM but selecting all your table with ALL or ALLSELECTED depending on your need.
Then you can divide the filtered sum by the second and format your measure as %.
It could look like :
MyPercentage =
VAR FilteredSum = CALCULATE (
SUM('YourTable'[TY_Actual],
FILTER('YourTable', 'YourTable'[Daypart] = SELECTEDVALUE('YourTable'[Daypart])
)
VAR GlobalSum = SUM('YourTable'[TY_Actual])
RETURN DIVIDE(FilteredSum, GlobalSum)
Hope it helps
Vincent BLOT
Did I answer your question? Mark my post as a solution!
not working sir
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
11 | |
10 | |
7 |