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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Touliloop
Helper I
Helper I

How to have my YoY change formated as percentage point instead of percentage for one specific row?

I have a measure in a table to show each years value and the YoY changes of the corresponding values.
The measure is defined as follows:

# Calculation_overview_yoy = 
VAR _attribution = SELECTEDVALUE(table[Attribute])
VAR _year = SELECTEDVALUE('Column name overview'[Year])

VAR _yoy_last =
CALCULATE(MAX(table[Year]), ALL ())
VAR _yoy_previous = _yoy_last - 1

VAR _last =
CALCULATE(
SUM('table'[Value]),
REMOVEFILTERS('Column name overview'[Year]),
'table'[Year] = _yoy_last
)

VAR _previous =
CALCULATE(
SUM('table'[Value]),
REMOVEFILTERS('Column name overview'[Year]),
'table'[Year] = _yoy_previous
)
VAR _last_0 = COALESCE(_last,0)
VAR _previous_0 = COALESCE(_previous,0)

VAR _yoy =
IF(
    _attribution = "Growth",
    _last_0 - _previous_0,           
    DIVIDE(_last_0 - _previous_0, _previous_0)  
)

VAR _raw_value = SUM('table'[Value])
RETURN
    SWITCH(
           TRUE(),
           _year = "YoY" && _attribution = "Growth", FORMAT(_yoy, "0.0") & "pp",
           _year = "YoY", FORMAT(_yoy, "0.0%"),
           _attribution = "Visit before", FORMAT(_raw_value, "0.0"),
           _attribution = "Visit after", FORMAT(_raw_value, "0.0"),
           _attribution = "Growth", FORMAT(_raw_value, "0,0%"),
           _attribution = "Cost", FORMAT(_raw_value, "0.0 €"),
           _raw_value
    )

I tried many different things, but I couldn't manage to make the YoY change of attribution "Growth" be formated as percentage point, e.g. 0.1 pp but it just keep showing percentage change. I have a slicer Country to filter the country. Sample data as follows:

AttributeValueCountry Year
Cost28US2025
Cost29CA2024
Cost30CH2024
Cost31AT2024
Cost15IT2024
Cost15US2024
Cost15CA2025
Cost15CH2025
Cost32AT2025
Cost33IT2025
Cost34PT2025
Growth0,052631579US2024
Growth0,034482759CA2024
Growth0,025641026CH2024
Growth0,020408163AT2024
Growth0,016949153IT2024
Growth0,014492754US2025
Growth0,012658228CA2025
Growth0,011235955CH2025
Growth0,01010101AT2025
Growth0,009174312IT2025
Growth0,008403361PT2025
Visit before1,9US2024
Visit before2,9CA2024
Visit before3,9CH2024
Visit before4,9AT2024
Visit before5,9IT2024
Visit before6,9US2025
Visit before7,9CA2025
Visit before8,9CH2025
Visit before9,9AT2025
Visit before10,9IT2025
Visit before11,9PT2025
Visit after2AT2024
Visit after3US2024
Visit after4CA2024
Visit after5CH2024
Visit after6CH2025
Visit after7US2025
Visit after8IT2024
Visit after9CA2025
Visit after10AT2025
Visit after11IT2025
Visit after12PT2025

The wished output will be like for example for Country US using the sample data above:
301_94_1.png

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-pgoloju
Community Support
Community Support

Hi @Touliloop,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @amitchandak , @Anand24 and @KarinSzilagyi  for prompt and helpful responses.

 

 

Replace this part
_year = "YoY" && _attribution = "Growth", FORMAT(_yoy, "0.0") & "pp",

 

with below one

_year = "YoY" && _attribution = "Growth",
FORMAT ( _yoy * 100, "0.0" ) & " pp",

 

Thanks & Regards,

Prasanna Kumar

View solution in original post

10 REPLIES 10
v-pgoloju
Community Support
Community Support

Hi @Touliloop,

 

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

v-pgoloju
Community Support
Community Support

Hi @Touliloop,

 

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

v-pgoloju
Community Support
Community Support

Hi @Touliloop,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @amitchandak , @Anand24 and @KarinSzilagyi  for prompt and helpful responses.

 

 

Replace this part
_year = "YoY" && _attribution = "Growth", FORMAT(_yoy, "0.0") & "pp",

 

with below one

_year = "YoY" && _attribution = "Growth",
FORMAT ( _yoy * 100, "0.0" ) & " pp",

 

Thanks & Regards,

Prasanna Kumar

amitchandak
Super User
Super User

@Touliloop , first, have a separate date year table.
Then measure 
Total = Sum(Table[value]) 

 

You can have these measures 
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

You can have the same aas items of calculation groups 

For format, use a dynamic String calculation of measure or a calculation group  
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings

https://www.sqlbi.com/articles/dynamic-format-strings-with-calculation-groups/



Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak thanks for your reply, could you please have a look at the DAX code I attached above? I have several visuals using this method, everything is fine, only when _attribute = 'Growth', the yoy calculation doesn't go by _last - _previous but DIVIDE(_last_0 - _previous_0, _previous_0) as other attributes, I just need to fix this one thing. To rebuild calculation groups will be very time consuming, could you please have a look?🙏

@amitchandak so the question is more like, why 

VAR _yoy =
IF(
    _attribution = "Growth",
    _last_0 - _previous_0,           
    DIVIDE(_last_0 - _previous_0, _previous_0)  
)

isn't this working and how to fix it. 

Anand24
Super User
Super User

Hi @Touliloop,
Try this: FORMAT(_raw_value, "0.0%")

Anand24_0-1765380246712.png

 

 

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

Hi, thanks for your reply, but it is not to format decimal number to percentage, but to calculate the yoy change of one measure like this

_last_0 - _previous_0

while for other attributes we calculate the yoy changes like this:

DIVIDE(_last_0 - _previous_0, _previous_0)
KarinSzilagyi
Super User
Super User

Hi @Touliloop, the issue is most likely that your clause for the percentage isn't specific enough at the moment, which might overwrite the first condition. 

Try to change your last part to this:

From:

_year = "YoY" && _attribution = "Growth", FORMAT(_yoy, "0.0") & " pp",
_year = "YoY", FORMAT(_yoy, "0.0%"),

To:

_year = "YoY" && _attribution = "Growth", FORMAT(_yoy, "0.0") & " pp",
_year = "YoY" && _attribution <> "Growth", FORMAT(_yoy, "0.0%"),

 
Or as a full Code:

# Calculation_overview_yoy = 
VAR _attribution = SELECTEDVALUE(table[Attribute])
VAR _year = SELECTEDVALUE('Column name overview'[Year])

VAR _yoy_last =
CALCULATE(MAX(table[Year]), ALL ())
VAR _yoy_previous = _yoy_last - 1

VAR _last =
CALCULATE(
SUM('table'[Value]),
REMOVEFILTERS('Column name overview'[Year]),
'table'[Year] = _yoy_last
)

VAR _previous =
CALCULATE(
SUM('table'[Value]),
REMOVEFILTERS('Column name overview'[Year]),
'table'[Year] = _yoy_previous
)
VAR _last_0 = COALESCE(_last,0)
VAR _previous_0 = COALESCE(_previous,0)

VAR _yoy =
IF(
    _attribution = "Growth",
    _last_0 - _previous_0,           
    DIVIDE(_last_0 - _previous_0, _previous_0)  
)

VAR _raw_value = SUM('table'[Value])
RETURN
    SWITCH(
           TRUE(),
           _year = "YoY" && _attribution = "Growth", FORMAT(_yoy, "0.0") & "pp",
           _year = "YoY" && _attribution <> "Growth", FORMAT(_yoy, "0.0%"),
           _attribution = "Visit before", FORMAT(_raw_value, "0.0"),
           _attribution = "Visit after", FORMAT(_raw_value, "0.0"),
           _attribution = "Growth", FORMAT(_raw_value, "0,0%"),
           _attribution = "Cost", FORMAT(_raw_value, "0.0 €"),
           _raw_value
    )

 



Did I answer your question? If so, please consider marking my response as the ‘Accepted Solution’ - it helps others with the same issue find the answer more easily!

hey, thanks for your reply, however it didn't work atfer I modify the last part. YoY "Growth" was still calculated as 

DIVIDE(_last_0 - _previous_0, _previous_0) 

instead of 

_last_0 - _previous_0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.