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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hood2media
Resolver I
Resolver I

dax | formatting issue in calculation group

hi,

as an intro, i have been using tabular editor 2 for some time to create calculation groups especially for time intelligence for without any issue. however, just today i found that there's an issue with format string expression where i'm not getting the numbers to be displayed as requested. 

as an example, before i get the display for yoy% to be correct as follows

hood2media_0-1698246140357.png

now, i get the incorrect values for yoy%

 

hood2media_1-1698246228737.png

i have also tried using the preview version of the 'native' calculation group function in power bi desktop but i'm also not getting the correct reading (in fact the ordinality of the columns also is affected despite correcting it manually). 

 

what seems to be the issue & how can this be resolved?

tks & krgds, -nik 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @hood2media 

 

You can try the following methods.
Measure:

Previous Year = 
Var _year=MAXX(FILTER(ALL('Table'),[Year]<SELECTEDVALUE('Table'[Year])),[Year])
Var _value=CALCULATE([Current],FILTER(ALL('Table'),[Year]=_year))
Return
_value
YoY = IF([Previous Year]=BLANK(),BLANK(),[Current]-[Previous Year])
YoY% = DIVIDE([YoY],[Previous Year])

vzhangti_0-1698394923491.png

Is this the result you expect? Please see the attached document.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @hood2media 

 

You can try the following methods.
Measure:

Previous Year = 
Var _year=MAXX(FILTER(ALL('Table'),[Year]<SELECTEDVALUE('Table'[Year])),[Year])
Var _value=CALCULATE([Current],FILTER(ALL('Table'),[Year]=_year))
Return
_value
YoY = IF([Previous Year]=BLANK(),BLANK(),[Current]-[Previous Year])
YoY% = DIVIDE([YoY],[Previous Year])

vzhangti_0-1698394923491.png

Is this the result you expect? Please see the attached document.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

MFelix
Super User
Super User

Hi @hood2media ,

 

Without more information is difficult to pin point your issue.

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



dear @MFelix & @v-zhangti,
many thanks for the interest to help.

 

i have managed to solve the (weird) problem. may be there was certain conflicts that caused the initial problem that is now gone & all is back to normal.

 

krgds, -nik

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.