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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Monthly view via Measure or is there a simpler/better column view?

Hi all,

If I want to display month values as columns in a table do I have a better way than the one I chose?

I have created **twelve** measures filtering on the month:

"EK in April = CALCULATE ([purchase value], FILTER ( EK_DATA_manual, EK_DATA_manual[month] = 4 ))"

In the long run, however, it becomes quite a lot to have additional tables that reference other data tables. Another way might be to "unpivot" the table.

 

How do we solve something like that?

 

Regards,

Nawaz

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

If your data is divided into multiple years, I suggest that you can display the year and month together for group display, because if you only display the month, when calculating, a certain month of multiple years will be calculated together , instead of calculating a certain year and month separately.

1. Use the CALENDAR function to create a calendar table with dates from DATE(2020,1,1) to DATE(2021,7,27)

vyangliumsft_0-1627435068043.png

2. Create a calculated column

Year_Month =
YEAR('Table'[Date])&"-"&MONTH('Table'[Date])

3. Result.

vyangliumsft_1-1627435068048.png

 

Best Regards,

Liu Yang

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
Ashish_Mathur
Super User
Super User

Hi,

How is your raw data structured.  Show that and your expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

If your data is divided into multiple years, I suggest that you can display the year and month together for group display, because if you only display the month, when calculating, a certain month of multiple years will be calculated together , instead of calculating a certain year and month separately.

1. Use the CALENDAR function to create a calendar table with dates from DATE(2020,1,1) to DATE(2021,7,27)

vyangliumsft_0-1627435068043.png

2. Create a calculated column

Year_Month =
YEAR('Table'[Date])&"-"&MONTH('Table'[Date])

3. Result.

vyangliumsft_1-1627435068048.png

 

Best Regards,

Liu Yang

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

DataZoe
Employee
Employee

@Anonymous have you tried using the Matrix visual?  You can then put [Purchase Value] in Values, then [Month] in the Columns, just like a pivot table.  

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.