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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
windykalra
New Member

Countifs result from measures

Hello everyone,

 

This task would normally be very easy to accomplish on excel, but I have having trouble with DAX.

 

I have a table which have multiple columns.

I have created a measure to find the KPI by using the Divide function on dax, so my KPI is a measure.

 

Now I have a table that has those KPI by month for the curent fiscal year and by location:
The value that you see is based on :

KPI = Divide(
    SUM(Table1[Column1]),SUM(Table1[Column2]),BLANK())

Capture.JPG

 

All I am trying to do is count rows when the KPI is lesser than .80. 

So row 1 - 4 will show 0 (as all met the KPI), but row #5 will show 1 because KPI for that month July is 0.66. I want a total count for the rows in this year. On excel I would have just done "=COUNTIF(A1:M1,"<0.8")..  Any guidance would grealy be appreciated.

 

Regards,

 

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @windykalra ,

 

You may create a measure like this:

Below = 
COUNTROWS(
    FILTER(
        SUMMARIZE (
        'table',
        'Table'[Product],
        'Table'[Month],
        "Kpi", 
            [Kpi]
         ),
    [Kpi] < 0.96
    ) 
)

V-lianl-msft_0-1615776313787.png

 

Best Regards,
Liang
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

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @windykalra ,

 

You may create a measure like this:

Below = 
COUNTROWS(
    FILTER(
        SUMMARIZE (
        'table',
        'Table'[Product],
        'Table'[Month],
        "Kpi", 
            [Kpi]
         ),
    [Kpi] < 0.96
    ) 
)

V-lianl-msft_0-1615776313787.png

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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