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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Colouring this week x axis in graph

Hi Masters,

 

I want to colour W38 to show which week we are like below.

this week color.PNG

Is it possible? any advice would be much appreciated.

 

thank you,

CL

1 ACCEPTED SOLUTION

@Anonymous Oh, wait, syntax error, missing )

Measure = 
  VAR __Date = MAX('Table'[Date])
RETURN
  IF(WEEKNUM(__Date) = WEEKNUM(TODAY()) && YEAR(__Date) = YEAR(TODAY()),1,BLANK())


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

16 REPLIES 16
Greg_Deckler
Community Champion
Community Champion

@Anonymous I don't see where you can set the color of a line based on a formula yet. So like:

Measure = IF(WEEKNUM(MAX('Table'[Date]))=WEEKNUM(TODAY()),1,BLANK())


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler 

 

X axis in the graph, there are Weeks,

 

2020-21, 2020-22, 2020-23, 2020-24 . . . . . 

 

i want to colour 2020-38.

 

@Anonymous Right, still no conditional formatting for that. You could add a new line that only displays on the current week, so that it shows as a dot and set it to a value of 1 perhaps. Then that would indicate current week.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler, That's a good idea!

can you let me know what i should do if i'd like to have the line?

 

thanks,

CL

@Anonymous Thinking:

Measure = IF(WEEKNUM(MAX('Table'[Date]))=WEEKNUM(TODAY()),1,BLANK())


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler for how, it shows 2019-38 and 2020-38 for dot..

 

this week 2.PNG

@Anonymous Hah!, didn't think about that! OK, that's easy to fix:

Measure = 
  VAR __Date = MAX('Table'[Date])
RETURN
  IF(WEEKNUM(__Date) = WEEKNUM(TODAY() && YEAR(__Date) = YEAR(TODAY()),1,BLANK())

 



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi  @Greg_Deckler  thanks for your reply.

I honestly have no idea of this dax..

 

this time, it didn't appear? 

COLOURING1.PNG

@Anonymous Oh, wait, syntax error, missing )

Measure = 
  VAR __Date = MAX('Table'[Date])
RETURN
  IF(WEEKNUM(__Date) = WEEKNUM(TODAY()) && YEAR(__Date) = YEAR(TODAY()),1,BLANK())


Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  oh.. that's too bad.... okay thank you so much for your help in anyways! 🙂

 

@Anonymous Sorry we couldn't get there completely in the end, but if this at least gets you something, mark it as an answer so others can benefit! 🙂



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Anonymous Hmm, so Calendar[Date] is used in you x-axis?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

 

I used Week but this made up based on date like below

week.PNG

@Anonymous I think it was a syntax error on my part, corrected below.

Measure = 
  VAR __Date = MAX('Table'[Date])
RETURN
  IF(WEEKNUM(__Date) = WEEKNUM(TODAY()) && YEAR(__Date) = YEAR(TODAY()),1,BLANK())

 



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  got it!

but can it become a line??

 

got it.PNG

@Anonymous Unfortunately no, haven't found a way to draw vertical lines on line charts yet. The Analytics pane only allows horizontal lines. Unless...you want to create a bunch of those measures, each with a different value that is returned, so think 10 of those measures that return values from 1 to 10 each, then they would show up stacked vertically on the graph. Maybe create one for every 2000?  😞



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors