Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
Solved! Go to Solution.
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... 🙂
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.
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
Proud to be a Super User!
Thanks for your response.
I want to format based on specific field Responsetype.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
5 | |
4 | |
2 | |
2 | |
1 |
User | Count |
---|---|
7 | |
6 | |
6 | |
4 | |
3 |