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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ErikHswe
Regular Visitor

How to count rows of a measure in a table visual

Hello,

I have a visual table containing 5 columns where 4 of those are measures.

Here is what they look:

 

Result this month = sum('q_view_pbi_invoice'[InvoiceAmountCUR])

Result last month = CALCULATE('q_view_pbi_invoice'[Utfall månad period invoice]; PREVIOUSMONTH('q_view_pbi_calendar'[CalendarDate]) )

Difference = q_view_pbi_invoice[Utfall månad period invoice] - q_view_pbi_invoice[Utfall fg månad period invoice]

Is difference positiv or negative = IF([diff kr invoice] <= 0; 0;1) 

 

 

Now, I want to count the last measure and display in a KPI how many results are negative and how many are positive for the current period (determined in a slicer visual). But I have tried a thousand things and nothing seems to work. Any advice would be appreciated.

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@ErikHswe

 

To use apply calculation based on the result of measure, you have to summarize the measure into column group on data feild you put on row level in Table visual. Then you can create a measure like below:

 

Count Of Postive =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            Table,
            Table[Row_Entry],
            "Is difference positiv or negative", [Is difference positiv or negative]
        ),
        [Is difference positiv or negative] = 1
    )
)

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Employee
Employee

@ErikHswe

 

To use apply calculation based on the result of measure, you have to summarize the measure into column group on data feild you put on row level in Table visual. Then you can create a measure like below:

 

Count Of Postive =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            Table,
            Table[Row_Entry],
            "Is difference positiv or negative", [Is difference positiv or negative]
        ),
        [Is difference positiv or negative] = 1
    )
)

Regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.