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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
BalaKiran_M
Frequent Visitor

Need help in DAX in Line Chart

Experts, please help me on DAX column for sorting the current year & previous year.

The scenario is, we have one date column which holds the data for last 365 days and we have a requirement to show 2 lines on the Y-Axix i.e. one is for current year & previous year for comparing both year values. But, unfortunatley when we see on the current date it it is broken the line for previous year. please help?

 

BalaKiran_M_0-1677594948619.png

 

16 REPLIES 16
andhiii079845
Super User
Super User

I find a solution perhaps but your data is more the probem:

andhiii079845_0-1678205650197.png

How you want to show the value from last year when your data are missing there?!
Example: 01.02.2023 -> 01.02.2022 but your mininum Date in 2022 ist 02.03.2022!
THIS DO NOT WORK ! 🙂 
Possible is something like this. To bring both line together is not possible of missing data!

andhiii079845_1-1678205887805.png

 

 

 





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

Proud to be a Super User!




andhiii079845
Super User
Super User

Without the sample data and .pbix i have no idea what is the problem.





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

Proud to be a Super User!




Experts, please help me on this. The dark blue line in breaking due to there is no value populated in the date column i.e 03/01/2022 which causes the breaking. please suggest?

 

BalaKiran_M_0-1677681041442.png

 

I am ready to upload the .pbix file, please guide me to upload the file.

upload it via the common upload services. if you have no sensitive data in the pbix





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

Proud to be a Super User!




@andhiii079845 I am really not sure where to upload it, kindly help me to navigate to upload it.

you have to us a external service. like dropbox, wetransfer etc.





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

Proud to be a Super User!




I see the problem. You want to compate both years, right? 
You can not us than the regular date field MM/DD/YYYY. and also as a legend the year flag.
If you want to compare both years, i can fix it. 🙂





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

Proud to be a Super User!




Yes @andhiii079845 please help on this. I didn't get any resolution sofar on this, please help tp compare both years with the given dates.

 

Thanks,

Bala

I can not open the old .pbi again in the moment.
One way: You can create a new column only for MM/DD not YYYY/MM/DD(!) and one column for year YYYY. Put MM/DD in the x-axis and YYYY in the legend.  Then you are able to see both lines for the years. 





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

Proud to be a Super User!




@andhiii079845 tried your suggestion, but it is not showing as two lines separately. Also, sharing my latest file via Google drive. please help.

https://drive.google.com/drive/folders/1SwL4aqyUClmRGOtnraHit_5EzGxD7aBb?usp=sharing

 

BalaKiran_M_0-1678187638408.png

 

It not easy. I see know the problem. I have to think about.





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

Proud to be a Super User!




BalaKiran_M
Frequent Visitor

@amitchandak sir please help

andhiii079845
Super User
Super User

For me is not 100 % clear how you create this vertical line. Can you explain it, please? 





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

Proud to be a Super User!




That's just a mouse hoverover to show the points is broken for the last year.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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