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

MTD YTD issue on histogram

Hey guys, i am really struggling with this right now, hope you can help me. Basically, I finally got the right numbers using MTD and YTD for my calculations but now I need to display them on the histogram, but I need them to be split up on histogram like three seperate measures, just like shown below. However, This is what I get right now. And everytime i take off date hierarchy or  do something else, then the MTD function doesnt work. 

Gediminas12_1-1604998520222.png

 

Gediminas12_0-1604998496639.png

 

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

Hi @Anonymous ,

According to my understand , you want to set measure name as X-axis, right?

You could create a new table like this:
11.12.2.1.PNG 

And then use SWITCH() function to match each measure:

Measure =
SWITCH ( MAX ( 'For X-axis'[Type] ), "YTD", [YTD], "MTD", [MTD] )

Then you could "seperate" measures in visual:

11.12.2.2.PNG

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@v-eqin-msft  It actually worked now !! Thank you so much.

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

According to my understand , you want to set measure name as X-axis, right?

You could create a new table like this:
11.12.2.1.PNG 

And then use SWITCH() function to match each measure:

Measure =
SWITCH ( MAX ( 'For X-axis'[Type] ), "YTD", [YTD], "MTD", [MTD] )

Then you could "seperate" measures in visual:

11.12.2.2.PNG

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

@v-eqin-msft  Hi Eyelyn, thats actually very helpful. The only thing is that instead of YTD I want to display MTD LY, but when I change everything to that, I get blank histogram.

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.