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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
LiborK
Frequent Visitor

Running total line until last day from chart

Hello,

I am new in dax.

Problem: I have a table which have 3 columns (ID,TYPE,DATE). ID+TYPE is unique combination.

I create running total measure: 

CALCULATE(

    DistinctCountID,

    FILTER(

        ALLSELECTED(DATE,

        ISONORAFTER(DATE, MAX(DATE), DESC)

    )

)

The result of the CHART IS: 

LiborK_0-1663938638014.png

But I would like to see this: 

LiborK_2-1663938793102.png

 

How can I rewrite the query to be able to see the redline at least a straight, if there will be no data for red TYPE in the last DATE in the chart?  

(BTW: I can't create another simple table, because the ID is used in model for filtering)

 

Thank you in advance.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@LiborK , You shoudl use a date table, marked as date table joined with you date of table

 

CALCULATE(

Distinctcount(Table[ID]) ,

FILTER(

ALLSELECTED('Date') , 'Date'[Date] <= Max('Date'[Date])

)

)

 

Rolling Days Formula: https://youtu.be/cJVj5nhkKBw

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @LiborK 

 

You can try the following methods.
Sample data:

vzhangti_0-1664177159041.png

Measure = 
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),[Date]<=SELECTEDVALUE('Table'[Date])))

vzhangti_1-1664177240932.png

Is this similar to the output you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, thank you for your answer. I tried your query, bud the result is different:

LiborK_0-1664443531755.png

The data look like this example: 

LiborK_1-1664443571731.png

 

amitchandak
Super User
Super User

@LiborK , You shoudl use a date table, marked as date table joined with you date of table

 

CALCULATE(

Distinctcount(Table[ID]) ,

FILTER(

ALLSELECTED('Date') , 'Date'[Date] <= Max('Date'[Date])

)

)

 

Rolling Days Formula: https://youtu.be/cJVj5nhkKBw

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, you were right.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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