Forum Discussion
Cevola
3 years agoHelper I
Summarize DAX help
Hello I have the following visual Measure=Pictures per camera / Accidents per segmet. How do i write the measure to summarize the data based on Segment. I am expecting the result as ...
- 3 years ago
Hi, Cevola
You can try the following methods.
Measure = Var _N1=CALCULATE(SUM('Table'[Pictures per Camera]),ALLEXCEPT('Table','Table'[Segment])) Var _N2=CALCULATE(MAX('Table'[Accidents per segment]),ALLEXCEPT('Table','Table'[Camera])) Return DIVIDE(_N1,_N2)Or:
Measure 2 = Var _table=SUMMARIZE(ALL('Table'),'Table'[Segment],'Table'[Accidents per segment],"DIVIDE",SUM('Table'[Pictures per Camera])/MAX([Accidents per segment])) Var _Divide=SUMX(FILTER(_table,[Segment]=MAX('Table'[Segment])),[DIVIDE]) Return _DivideIs this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
3 years agoCommunity Support
Hi, Cevola
You can try the following methods.
Measure =
Var _N1=CALCULATE(SUM('Table'[Pictures per Camera]),ALLEXCEPT('Table','Table'[Segment]))
Var _N2=CALCULATE(MAX('Table'[Accidents per segment]),ALLEXCEPT('Table','Table'[Camera]))
Return
DIVIDE(_N1,_N2)
Or:
Measure 2 =
Var _table=SUMMARIZE(ALL('Table'),'Table'[Segment],'Table'[Accidents per segment],"DIVIDE",SUM('Table'[Pictures per Camera])/MAX([Accidents per segment]))
Var _Divide=SUMX(FILTER(_table,[Segment]=MAX('Table'[Segment])),[DIVIDE])
Return
_Divide
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.