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
lavdeepk
Resolver I
Resolver I

Countif power Pivot Dax measure

Hi Expert,

I am straggling with power Pivot Dax measure .

 

Here is my dax code:

(Code calculate distinct customer where [Product Group] = "NP FP PG"  Now i want add new condition measure output should be >0 then count 1 

but  no idea what to do next ??

NPFPPG =
CALCULATE (
    DISTINCTCOUNT ( Collection[CustomerID] ),
    FILTER ( Collection, ( [Product Group] = "NP FP PG" ) )
)

Thanks

Lavdeep

 

 

3 REPLIES 3
AlB
Super User
Super User

Hi @lavdeepk 

I do not undesrtand the condition you want to add. Can you perhaps provide an example?

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers 

SU18_powerbi_badge

Hi @AlB ,
Sorry for in convince i trying again to explain you.
I have created a measure (code is below) If this measure return output 1 then count 1 if 0 then return 0
i am able to achieve desired output in excel file but straggling in DAX.Refer below SS this may helpful to understand my issue

Capture.JPG

 

NPFPPG =
CALCULATE (
    DISTINCTCOUNT ( Collection[CustomerID] ),
    FILTER ( Collection, ( [Product Group] = "NP FP PG" ) )
) 

@lavdeepk 

Try

 

NPFPPG V2 =
IF( CALCULATE (
    DISTINCTCOUNT ( Collection[CustomerID] ),
    FILTER ( Collection, ( [Product Group] = "NP FP PG" ) )
) > 0, 1,0 )

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

 

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.