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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
EugenioProlog
Helper III
Helper III

Need to make a Cumulative count but can only count a company once

I have this metric to count the numbers of meetings that happened inside support tickets on each day:

Qtd Reuniões | Tickets =
CALCULATE(
    COUNTROWS(fct__comercial__atividades__reunioes),
    FILTER(
        fct__comercial__atividades__reunioes,
        fct__comercial__atividades__reunioes[atividade_id] IN
        SELECTCOLUMNS(
            fct__comercial__atividades__reunioes__vinculo__tickets,
            "atividade_id"fct__comercial__atividades__reunioes__vinculo__tickets[atividade_id]
        )
    )
)

I have this metric to display the cumulative ammount, so I can plot the cumulative total on a day axis:


Qtd Reuniões | Tickets Acumulado =
CALCULATE(
    [Qtd Reuniões | Tickets],
    FILTER(
        ALLSELECTED( dim__calendario ),
        dim__calendario[dt_data] <= MAX( dim__calendario[dt_data] )
    )
)

Now I need to create a third metric that is a variation of the second one. I need to count the numbers of different companies that had a meeting. So, for example, if one company had 4 meetings, it will count as 4 to the previous metric, but it will count only as 1 to this new metric.
Here is the relation between my meetings table and my company information:
EugenioProlog_0-1757514419754.png

 

fct__comercial__atividades__reunioes goes to fct__comercial__atividades__reunioes__vinculo__tickets using atividade_id
fct__comercial__atividades__reunioes__vinculo__tickets goes to dim__cx__tickets using ticket_id
dim__cx__tickets goest to fct__cx__tickets using ticket_id

fct__cx__ticket contains empresa_id (company_id column that is a unique identifier of the company)


 

1 ACCEPTED SOLUTION

Try

Num companies =
VAR BaseTable =
    ADDCOLUMNS (
        SUMMARIZE (
            fct__cx__ticket,
            fct__cx__ticket[empresa_id],
            dim__cx__tickets[fct__cx__tickets using ticket_id]
        ),
        "@num", [Qtd Reuniões | Tickets]
    )
VAR GroupedTable =
    GROUPBY (
        BaseTable,
        fct__cx__ticket[empresa_id],
        "@total", SUMX ( CURRENTGROUP (), [@num] )
    )
VAR Result =
    COUNTROWS ( GroupedTable )
RETURN
    Result

View solution in original post

6 REPLIES 6
v-venuppu
Community Support
Community Support

Hi @EugenioProlog ,

I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.

Thank you.

v-venuppu
Community Support
Community Support

Hi @EugenioProlog ,

May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

Thank you.

v-venuppu
Community Support
Community Support

Hi @EugenioProlog ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @johnt75 for the prompt response.

I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

Thank you.

johnt75
Super User
Super User

I'm not sure if this will work, but you could try opening DAX Query View and running

EVALUATE
SUMMARIZECOLUMNS (
    fct__cx__ticket[empresa_id],
    "@num", [Qtd Reuniões | Tickets]
)

If that gives correct numbers then you could embed it in a measure like

Num companies =
COUNTROWS (
    FILTER (
        SUMMARIZECOLUMNS (
            fct__cx__ticket[empresa_id],
            "@num", [Qtd Reuniões | Tickets]
        ),
        NOT ISBLANK ( fct__cx__ticket[empresa_id] )
    )
)

That did not work

EugenioProlog_0-1757521045688.png

 

 

Try

Num companies =
VAR BaseTable =
    ADDCOLUMNS (
        SUMMARIZE (
            fct__cx__ticket,
            fct__cx__ticket[empresa_id],
            dim__cx__tickets[fct__cx__tickets using ticket_id]
        ),
        "@num", [Qtd Reuniões | Tickets]
    )
VAR GroupedTable =
    GROUPBY (
        BaseTable,
        fct__cx__ticket[empresa_id],
        "@total", SUMX ( CURRENTGROUP (), [@num] )
    )
VAR Result =
    COUNTROWS ( GroupedTable )
RETURN
    Result

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.