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
Adelphe
Regular Visitor

Dax measure to calculate a formula with blanks values

Hello ,

i am a beginner in dax and i need help , with the following table 

 

Adelphe_1-1728106337695.png

 

i would like to write a dax query to calculate the Result.
in DAX i have tried the following :

Adelphe_2-1728107422132.png

when i summarize , i am loosing SAM rows because of Blanks values , can i keep those blanks and have the right result.

2 ACCEPTED SOLUTIONS
dharmendars007
Super User
Super User

Hello @Adelphe , 

 

Please use this formula to create a calculated column, to get the "0" included in your table.

 

Result =
VAR CurrentMonth = [Month]
VAR TotalLevelPerMonth = CALCULATE(SUM('Table'[Level]),ALLEXCEPT('Table', 'Table'[Month]))
RETURN
IF(TotalLevelPerMonth = 0, BLANK(), [Experience] * [Level] / TotalLevelPerMonth)

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

View solution in original post

Anonymous
Not applicable

Hi @Adelphe ,

 

Thanks for @dharmendars007 reply, that's really helpful!

 

@Adelphe Here is another method for your reference.

SUMMARIZECOLUMNS('Table'[Username],'Table'[Year],'Table'[Month],'Table'[Level],'Table'[Experience],"Result",IF(ISBLANK(MAX('Table'[Experience])),0,MAX('Table'[Level])*MAX('Table'[Experience])/CALCULATE(SUM('Table'[Level]),FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])))))

The result of my test.

vmengmlimsft_0-1728467314031.png

 

 

 

Best regards,

Mengmeng Li

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Adelphe ,

 

Thanks for @dharmendars007 reply, that's really helpful!

 

@Adelphe Here is another method for your reference.

SUMMARIZECOLUMNS('Table'[Username],'Table'[Year],'Table'[Month],'Table'[Level],'Table'[Experience],"Result",IF(ISBLANK(MAX('Table'[Experience])),0,MAX('Table'[Level])*MAX('Table'[Experience])/CALCULATE(SUM('Table'[Level]),FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])))))

The result of my test.

vmengmlimsft_0-1728467314031.png

 

 

 

Best regards,

Mengmeng Li

dharmendars007
Super User
Super User

Hello @Adelphe , 

 

Please use this formula to create a calculated column, to get the "0" included in your table.

 

Result =
VAR CurrentMonth = [Month]
VAR TotalLevelPerMonth = CALCULATE(SUM('Table'[Level]),ALLEXCEPT('Table', 'Table'[Month]))
RETURN
IF(TotalLevelPerMonth = 0, BLANK(), [Experience] * [Level] / TotalLevelPerMonth)

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

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.