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
hima2002
Employee
Employee

Change date on X-axis to be monthly/daily/yearly instead of showing every run individually

I have this chart that shows if a run has succeeded or failed, the graph currently shows every run individually on the X-axis. I would like to have the option to change it to a monthly view or yearly or daily and to have it show the percentage of failed to succeeded in that time frame instead of showing them for each job. Can I get some help with this?

Screenshot (23).png

2 ACCEPTED SOLUTIONS
hnguy71
Memorable Member
Memorable Member

@hima2002 ,


You would need a minimum of three columns in your date table. Similar to this:

hnguy71_0-1664718181913.png

 

Then click on Modeling > New Parameter > Fields

hnguy71_1-1664718231759.png

 

Then add/drag your fields from your date table to the left box.

hnguy71_2-1664718298091.png

 

Then finally add the new "Fields" value into your X-Axis of your visual. You should be able to switch it like so

2022-10-02_08h46_57.gif

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

@hima2002 OK, so if you want to turn on auto time intelligence, in the Desktop you go to File, Options and settings, Options and then under CURRENT FILE choose Data Load and check the box for Auto date/time:

Greg_Deckler_0-1664720541733.png

If you want to create calculated columns, in your Fields pane, right click the table and choose New column and paste in the DAX code I provided. Note, the code is for 4 separate columns, Year, Month, MonthSort and Day. Then, right-click the table and choose New measure and paste in the DAX measure code provided.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

8 REPLIES 8
hnguy71
Memorable Member
Memorable Member

@hima2002 ,


You would need a minimum of three columns in your date table. Similar to this:

hnguy71_0-1664718181913.png

 

Then click on Modeling > New Parameter > Fields

hnguy71_1-1664718231759.png

 

Then add/drag your fields from your date table to the left box.

hnguy71_2-1664718298091.png

 

Then finally add the new "Fields" value into your X-Axis of your visual. You should be able to switch it like so

2022-10-02_08h46_57.gif

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thanks for the quick response !

However my dates are currently in this format. How can I change them so that I am able to choose the desired granularity.

Screenshot (25).png

@hima2002 You can create the columns as I posted or you can turn on Auto-Time Intelligence (I wouldn't recommend the latter)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes but i have a very large amount of data, changing it to the proposed format would take a long time to do indivually. Is there a way to change automatically?

@hima2002 I don't understand why it would take a long time. Creating DAX columns generally takes mere seconds to calculate. If you turn on auto-time intelligence that would automatically generate a hierarchy for any Date or Date/time column. I guess you could consider that "automatic". The downside is that it can really bloat your data model. I've shrunk data models by up to 40% by just turning off auto-time intelligence.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Im new to PowerBi so i dont know exactly how to do that.

@hima2002 OK, so if you want to turn on auto time intelligence, in the Desktop you go to File, Options and settings, Options and then under CURRENT FILE choose Data Load and check the box for Auto date/time:

Greg_Deckler_0-1664720541733.png

If you want to create calculated columns, in your Fields pane, right click the table and choose New column and paste in the DAX code I provided. Note, the code is for 4 separate columns, Year, Month, MonthSort and Day. Then, right-click the table and choose New measure and paste in the DAX measure code provided.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@hima2002 So, create columns for Month, Year and Day:

Year = YEAR([Date])

Month = FORMAT([Date],"mmmm")

MonthSort = MONTH([Date])

Day = DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))

Then a measure something like:

Measure =
  VAR __Total = COUNTROWS('Table')
  VAR __Failed = COUNTROWS(FILTER('Table',[Status] = "Failed"))
RETURN
  DIVIDE(__Failed, __Total, 0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.