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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
asudhakar707
New Member

Power Bi Dax query for actual and new value (Line Chart & Dotted chart)

The line representing the sum of sales value should transition from dotted to solid based on the first refresh occurring on July 15, 2025, and October 15, 2025.

  1. Current State (Before July 15, 2025):

    • The line between Q1 and Q2 should remain dotted.

  2. Changes Effective July 15, 2025:

    • The line between Q1 and Q2 should change to solid.

    • The line between Q2 and Q4 should remain dotted.

  3. Changes Effective October 15, 2025:

    • The line between Q1 and Q3 should change to solid.

    • The line between Q3 and Q4 should remain dotted.

      Please help me for the above requirement.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @asudhakar707,

Thank you for reaching out in Microsoft Community Forum.

Thank you @samratpbi , @maruthisp  for the helpful response.

Power BI can’t change line style within a single line series dynamically, so split the line into multiple series, each representing a segment between quarters. Use DAX measures that show sales values or blanks based on the current refresh date to control visibility.

please follow below steps to resolve the issue;

1.Create separate DAX measures for each quarter segment line (e.g., Q1-Q2, Q2-Q4, Q1-Q3, Q3-Q4).

2.Create a measure for the current refresh date (e.g., latest sales date).

3.Use conditional logic in each segment measure to return sales values or blanks based on the refresh date:

->Before July 15: only Q1-Q2 dotted.

->July 15 to Oct 14: Q1-Q2 solid + Q2-Q4 dotted.

->Oct 15 onwards: Q1-Q3 solid + Q3-Q4 dotted.

4.Plot these measures as separate series on the line chart.

5.Assign line styles manually per series:

->Solid lines for Q1-Q2 and Q1-Q3 (when active).

->Dotted lines for Q2-Q4 and Q3-Q4 (when active).

Please continue using Microsoft Community Forum.

If this post helps in resolve your issue, kindly consider marking it as "Accept as Solution" and give it a 'Kudos' to help others find it more easily.

Regards,
Pavan.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @asudhakar707,

I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.

Please continue using Microsoft community forum.

Thank you,
Pavan.

Anonymous
Not applicable

Hi @asudhakar707,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, kindly "Accept  as  Solution" and give it a 'Kudos' so others can find it easily.

Thank you,
Pavan.

Anonymous
Not applicable

Hi @asudhakar707,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please "Accept  as  Solution" and give a 'Kudos' so other members can easily find it.

Thank you,
Pavan.

asudhakar707
New Member

Hi Thank you for your above responce, my requirement similar to the above but slightly different, let me explain clearly let, suppose I a have sales data for 2025 and I present it using line chart showing quartearly sales value. Below is the requirement

1.for now the line between  Q1 and Q2 should be dotted.

A. on july 15 2025 onwards(when ever data set is refreshed) the line between  Q1 and Q2 should be solid. and the line between Q2 and Q4 remain dotted

B.  on Oct 15 2025 onwards the line between  Q1 and Q3 should be solid. and the line between Q3 and Q4 remain dotted.

 

 

Anonymous
Not applicable

Hi @asudhakar707,

Thank you for reaching out in Microsoft Community Forum.

Thank you @samratpbi , @maruthisp  for the helpful response.

Power BI can’t change line style within a single line series dynamically, so split the line into multiple series, each representing a segment between quarters. Use DAX measures that show sales values or blanks based on the current refresh date to control visibility.

please follow below steps to resolve the issue;

1.Create separate DAX measures for each quarter segment line (e.g., Q1-Q2, Q2-Q4, Q1-Q3, Q3-Q4).

2.Create a measure for the current refresh date (e.g., latest sales date).

3.Use conditional logic in each segment measure to return sales values or blanks based on the refresh date:

->Before July 15: only Q1-Q2 dotted.

->July 15 to Oct 14: Q1-Q2 solid + Q2-Q4 dotted.

->Oct 15 onwards: Q1-Q3 solid + Q3-Q4 dotted.

4.Plot these measures as separate series on the line chart.

5.Assign line styles manually per series:

->Solid lines for Q1-Q2 and Q1-Q3 (when active).

->Dotted lines for Q2-Q4 and Q3-Q4 (when active).

Please continue using Microsoft Community Forum.

If this post helps in resolve your issue, kindly consider marking it as "Accept as Solution" and give it a 'Kudos' to help others find it more easily.

Regards,
Pavan.

Hi, Thanks. you can replace TODAY() function with your dates with IF condition, if you have fixed dates. Thanks - Samrat

maruthisp
Super User
Super User

Hi asudhakar707,

As I am not sure how the data looks from your side, I tried to arrange sample data and the results look like below:

maruthisp_0-1747359355228.png
Please find the attached pbix file for you reference.
Power Bi Dax query for actual and new value (Line Chart & Dotted chart).pbix
Please let me know if you hae any questions and thanks in advance.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X

samratpbi
Super User
Super User

Hi, I am not sure about your data, hence I have created based on current date. i.e. anything before current date will have solid line and future dates will have dotted line. 

first, simply create a sum measure:

Total Value = SUM(Date_Line[Value])
Then create another 2 measures for History and Future:
Total Value History =
IF(
    MAX(Date_Line[Date]) <= TODAY(),
    [Total Value],
    BLANK()
)
Total Value Future =
IF(
    MAX(Date_Line[Date]) > TODAY(),
    [Total Value],
    BLANK()
)
[here you can replace today() with your date)
Then add those 2 measures in the line chart and make the future line chart as dotted.
 
samratpbi_0-1747333156958.png

If this helps to resolve your problem, then please mark it as solution, thanks - Samrat

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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