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
Anonymous
Not applicable

Aggregating daily sales into a monthly view by year

Hi all,

 

I'm fairly familiar with PowerBI but not so much in transforming data with PowerBI outside of what I am given. 

I get daily sales from an SQL server (third party platform sends information to me) and I am trying to sum all of the daily sales per month. I'd also like to view last year's sales and this year's sales on a bar graph if that is possible. 


I've been digging through multiple forums in this community and set up my information like so: 

obriql_0-1593617517616.png


However, I can't seem to figure out how to sort by month AND year and I get this:

obriql_1-1593617598563.png

As you can see, I got it to sort only by the month. 

 

The goal is to show 2019 and 2020 information side by side if possible and in order!

 

Please let me know if you need additional information from me. 

 

Thanks for the help!

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous

In fact, format function will transform values to text type and change the display format as you defined in optional parameters.
I'd like to suggest you take a look at the table field properties with custom display format.

12.png
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,

If you create a month like this or make this sort column you should get year togther

 

Month Year = format([date],"MMYYYY")

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

Anonymous
Not applicable

When I create "Month Year = format([date],"MMYYYY")", is this under transform data or as a new measure?

If it is the former, would it be a custom column?

Thanks

Hi @Anonymous

In fact, format function will transform values to text type and change the display format as you defined in optional parameters.
I'd like to suggest you take a look at the table field properties with custom display format.

12.png
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.