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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Kavya123
Helper III
Helper III

DAX expression using specific field

Hi Everyone,

 

Please help me to write expression in DAX.

 

My current expression is Sum( Value) . I want to display the value based on specific field  Response Type.

 

For ex: 1.If Responsetype is ###,###,###,##0.0% then value would be 104,336.8%

2. If Responsetype is ###,###,###,##0  then Value is 10,972  (without percentage)

 

Response Type

###,###,###,##0
###,###,###,##0%
###,###,###,##0.0
###,###,###,##0.0%
###,###,###,##0.00
###,###,###,##0.00%
$###,###,###,##0
$###,###,###,##0.00

 

Thanks in advance

 

1 ACCEPTED SOLUTION
josef78
Memorable Member
Memorable Member

Hi,

maybe try another forum group, like DAX commands and tips, bacause this is related on onpremise report server deployment, but....

 

...if you need sum, it is measure, you must solve how aggregate multiple formats to single result ... you can try:

 

if(HASONEVALUE([Responsetype]),format(SUM([Value]),FIRSTNONBLANK([Responsetype],1)),blank())

 

it will format sum of coumun based on format string in another columns, and in case multiple formats (e.g. last total row in visualisation) is returned blank value. But maybe found better approach, I'm not DAX expert... 🙂

View solution in original post

4 REPLIES 4
josef78
Memorable Member
Memorable Member

Hi,

maybe try another forum group, like DAX commands and tips, bacause this is related on onpremise report server deployment, but....

 

...if you need sum, it is measure, you must solve how aggregate multiple formats to single result ... you can try:

 

if(HASONEVALUE([Responsetype]),format(SUM([Value]),FIRSTNONBLANK([Responsetype],1)),blank())

 

it will format sum of coumun based on format string in another columns, and in case multiple formats (e.g. last total row in visualisation) is returned blank value. But maybe found better approach, I'm not DAX expert... 🙂

Thank you so much for your help.

FarhanAhmed
Community Champion
Community Champion

You may need to create CASES for each response type and try to use FORMAT DAX expression to convert your values in the specified format.

 

https://docs.microsoft.com/en-us/dax/format-function-dax

https://docs.microsoft.com/en-us/dax/switch-function-dax

 

 

 







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Thanks for your response.

 

I want to format based on specific field Responsetype.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.