Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Cevola
Helper I
Helper I

Summarize DAX help

Hello

 

I have the following visual

Cevola_0-1678991009632.png

 

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 

Segment        Camera      Pictures per Camera     Accidents per segment      Measure

A1_14b          7631            4302                                  4                                     1075.50

A1_17             1019           6969                                  9                                      1163.11

                       1020           3499                                          

A10/I_01         9024           14993                                12                                    1249.42

 

Please help me how to write the measure to summarize based on Segment.

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community 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

vzhangti_0-1679278776377.png

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.

 

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community 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

vzhangti_0-1679278776377.png

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.

 

wdx223_Daniel
Super User
Super User

Measure=DIVIDE(CALCULATE(SUM(Table[Pictures per camera]),ALLSELECTED(Table[Camera])), MAX(Table[Accidents per segmet]))

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.