Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

Divide Column By Column

Hi,

Is there a way to divide the count of bar marks per slice (i.e. 3 E12 for Slice S002) by the count of slices in a segment (i.e. 3 S002 for segment 01N)? 
The results for column S002 and row E12 would be 3/3 = 1.

 

 

Thank you,
Giovanni

 

5 Replies

  • Anonymous Create a measure to count bar marks per slice:

    BarMarksPerSlice = COUNTROWS('YourTable')

     

    Create a measure to count slices in a segment:

    SlicesInSegment = CALCULATE(
    DISTINCTCOUNT('YourTable'[SliceColumn]),
    ALLEXCEPT('YourTable', 'YourTable'[SegmentColumn])
    )

     

    Create a measure to divide the count of bar marks per slice by the count of slices in a segment:

    Result = DIVIDE([BarMarksPerSlice], [SlicesInSegment])

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Create a measure as

     Result=

    var A= count (your table[Bar mark])

    var B=Distinctcount(your table[Segment])

    result(A/B)

     

    Regards,

    Surya.

  • v-priyankata's avatar
    v-priyankata
    Community Support

    Hi Anonymous 

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

  • v-priyankata's avatar
    v-priyankata
    Community Support

    Hi Anonymous 
    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank you.

  • v-priyankata's avatar
    v-priyankata
    Community Support

    Hi Anonymous 
    I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
    Thank you.