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
TriveniN
Helper II
Helper II

How to do division, based on condition

Source data

NameDaysInPeriod(measure)
A92
A92
A 
B 
B92
C92

 

Expected output:  we need to group name based only if DaysInPeriod(measure) has value.

Here in this case count(name), where daysin period has value is 2 and it should be divided by daysIn Period/2

NameDaysInPeriod(measure)CountOutput
A92292/2=46
A92292/2=46
A   
B   
B92192/1=92
C92192/1=92

 

Help me out to get this

5 REPLIES 5
TriveniN
Helper II
Helper II

@lbendlin : Can you help me out to get that mentioned output 

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try creating a measure to work out the count then another to calculate the divide. You can combine them after you know it's working if needed.

 

measure 1 = CALCULATE(count('Table'[DaysInPeriod(measure)]),ALLEXCEPT('Table','Table'[Name]))
 
Measure 2 = DIVIDE(CALCULATE(max('Table'[DaysInPeriod(measure)])),[measure 1])
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Thanks for response .

Here DaysInPeriod(measure) is the measure, we can't apply count for measure right?

Ah okay, for the first measure try:

 

measure = if(not(ISBLANK([DaysInPeriod(measure)])),CALCULATE(COUNT('Table'[Name])),BLANK())
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Its not working out.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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