Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi everyone,
i would like to create a graph that has as X axis the months and as values 2 lines that represent:
1- monthly number of sales of the last 12 months (from august 2021 to august 2022)
2- monthly number of sales of the last 24 months (from august 2020 to august 2021)
The X axis should start from august to august ideally.
Could you help me solve this issue?
Many thanks!
Solved! Go to Solution.
Hi @Eleonora ,
Please try following DAX:
year = FORMAT('Sheet10'[Date],"yyyy")
month =
var _mon = FORMAT('Sheet10'[Date],"mmm")
var _aug = IF('Sheet10'[year] = "2022" && _mon = "Aug","Aug_22",_mon)
return _aug
Measure =
var _month = SELECTEDVALUE('Sheet10'[month])
var _sort = SWITCH(_month,
"Aug",1,
"Sep",2,
"Oct",3,
"Nov",4,
"Dec",5,
"Jan",6,
"Feb",7,
"Mar",8,
"Apr",9,
"May",10,
"Jun",11,
"Jul",12,
"Aug_22",13)
return _sort
Please add Measure to Tppltips:
Sort axis by Measure, the X axis will start from august to august:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Eleonora ,
Please try following DAX:
year = FORMAT('Sheet10'[Date],"yyyy")
month =
var _mon = FORMAT('Sheet10'[Date],"mmm")
var _aug = IF('Sheet10'[year] = "2022" && _mon = "Aug","Aug_22",_mon)
return _aug
Measure =
var _month = SELECTEDVALUE('Sheet10'[month])
var _sort = SWITCH(_month,
"Aug",1,
"Sep",2,
"Oct",3,
"Nov",4,
"Dec",5,
"Jan",6,
"Feb",7,
"Mar",8,
"Apr",9,
"May",10,
"Jun",11,
"Jul",12,
"Aug_22",13)
return _sort
Please add Measure to Tppltips:
Sort axis by Measure, the X axis will start from august to august:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ToddChitt , thank you for your help!
I did the calculated column and I put it as legend, but the plot starts from January, and not from august.
As you suggested I put the date in the X-axis just with the month.
Any idea how i can make it right?
Thanks!
You need 'seasonal' data. To get that, plot JUST the month name, properly sorted, and do a Legend by 'Plot Year'.
Your 'Plot Year' will need to start in August and end the following July.
'Plot Year' can be as simple as a calculated Column: IF (MONTH([Date]) > 6 , , )
Proud to be a Super User! | |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |