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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Augustas-ase
Helper II
Helper II

if countif and sumifs

My formula in excel is : =IF(COUNTIFS($N$1:N2;N2)=1;SUMIFS(U:U;Q:Q;"<="&Q2;N:N;N2);"")

 

how to write in PBI ?


Thank you.

3 REPLIES 3
Augustas-ase
Helper II
Helper II

who can help me?

Augustas-ase
Helper II
Helper II

Thanks for the formula, but everywhere I get an empty result 😕

Adamboer
Responsive Resident
Responsive Resident

In Power BI, you can create a measure using the DAX language that has similar functionality to the Excel formula you provided. Here's an example of how to write the measure in Power BI:

Measure =
IF(
COUNTROWS(
FILTER(
Table,
Table[N] = MAX(Table[N])
)
) = 1,
CALCULATE(
SUM(Table[U]),
FILTER(
Table,
Table[Q] <= MAX(Table[Q]) && Table[N] = MAX(Table[N])
)
),
BLANK()
)

You'll need to replace "Table" with the name of the table you're working with in Power BI. This measure will return the same results as the Excel formula you provided, but calculated within Power BI.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors