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
Murali777
Helper III
Helper III

Dimension and measure modeling for 2020,2021, LTM, YTD Prior and YTD in same axis

Hi Team,

 

I want to model my calendar table with 2020,2021, LTM, YTD Prior and YTD format (already having year column). For example, when i drag my column to x axis of bar chart it shoud show below measures "2020,2021, LTM, YTD Prior and YTD" and Y axis is the Value to show amoung the x axis. I want to implement the below chart with single barchart that contains 1 dimension value (x-axis) and 1 measure value (Y - axis).

Kindly help this scenario. to archieve this i have used muliple barchart and multiple measures. but i dont want that.

Hi @Jihwan_Kim 

pls help me on this.

Murali777_0-1669652815994.png

 

1 ACCEPTED SOLUTION

Hi Rico Zhou,

 

The solution you provided is next level. It works fine for me. 
Thank you so much!!!

 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Murali777 ,

 

Firstly, X axis in visual only support us add columns in them. As a column, you will load all data into Power BI data model. So the data like "2021", "2022", "LTM"... all should be in your data model. However these data don't seem to be in the same dimension. "2021"/"2022" seem to be years, "LTM"/"YTD"...seem to be aggregation based on years.

Here I suggest you to create a new table with all data you need in it to create the X axis. And then create a measure by Switch function.

X axis =
{ "2021", "2022", "LTM", "YTD Piror", "YTD" }

Measure:

VALUE =
SWITCH (
    SELECTEDVALUE ( 'X axis'[Value] ),
    "2021", ...,
    "2022", ...,
    "YTM", ...,
    "YTD Piror", ...,
    "YTD", ...
)

 

Best Regards,
Rico Zhou

 

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

 

Hi Rico Zhou,

 

I went for long leave. still i'm getting confused. can you pls share the simple PBIX file with the same result set?

 

Hi Rico Zhou,

 

The solution you provided is next level. It works fine for me. 
Thank you so much!!!

 

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.