The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
Hope someone can help. I've got the following Measure
Solved! Go to Solution.
Hi @SiGill1979 ,
Do you have any other fields on your form besides [Year] because sum() will group based on the fields placed on the form Visual.
If you want to group based on the [Year] field, you can place only [Year] and measure in the Form Visual.
If you have the rest of the fields and the [Year] field in Form Visual, and you want to group by [Year] field, you can change the measure。
Measure 2 =
var _sumGM=
SUMX(FILTER(ALL('ProfitabilityMASTERFinal'),'ProfitabilityMASTERFinal'[Year]=MAX('ProfitabilityMASTERFinal'[Year])),[GM])
var _sumnet=
SUMX(FILTER(ALL('ProfitabilityMASTERFinal'),'ProfitabilityMASTERFinal'[Year]=MAX('ProfitabilityMASTERFinal'[Year])),[Net Sales])
RETURN
if(
DIVIDE(_sumGM,_sumnet)>9.9999,9.9999,IF(DIVIDE(_sumGM,_sumnet)<-9.9999,-9.9999,DIVIDE(_sumGM,_sumnet)))
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
Hi @SiGill1979 ,
Do you have any other fields on your form besides [Year] because sum() will group based on the fields placed on the form Visual.
If you want to group based on the [Year] field, you can place only [Year] and measure in the Form Visual.
If you have the rest of the fields and the [Year] field in Form Visual, and you want to group by [Year] field, you can change the measure。
Measure 2 =
var _sumGM=
SUMX(FILTER(ALL('ProfitabilityMASTERFinal'),'ProfitabilityMASTERFinal'[Year]=MAX('ProfitabilityMASTERFinal'[Year])),[GM])
var _sumnet=
SUMX(FILTER(ALL('ProfitabilityMASTERFinal'),'ProfitabilityMASTERFinal'[Year]=MAX('ProfitabilityMASTERFinal'[Year])),[Net Sales])
RETURN
if(
DIVIDE(_sumGM,_sumnet)>9.9999,9.9999,IF(DIVIDE(_sumGM,_sumnet)<-9.9999,-9.9999,DIVIDE(_sumGM,_sumnet)))
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
That would be a question for your data model wiring. Same value in all rows = can't get there from here (for example you are trying to control a dimension from a fact). Which columns did you use for the visual?
By the way your measure can be simplified either via variables or via MinMax:
GM% =
MAX (
MIN (
DIVIDE (
SUM ( ProfitabilityMASTERFinal[GM] ),
SUM ( ProfitabilityMASTERFinal[Net Sales] ),
0
),
9.9999
),
-9.9999
)
User | Count |
---|---|
20 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
28 | |
12 | |
11 | |
9 | |
8 |