Forum Discussion
how to create a linear line in line chart
Hello everyone,
I have built a cumulative line in line visual and I want to create a linear line that will show 0 at the start and max Value at the end of the visual. Any tips ? I literally need the black line to be built. I am using dax so all measures are explicit but I cant figure out how to make this basic line :D.
I have tried this
this is the result
but I need this
I have already sorted it out. It was a need to remove a date filter only (for Trend WO number). everything else works just fine
Linear Line Plan =VAR __MinDate =[FirstDateWP]VAR __MinValue = 0VAR __MaxDate =[LastDateWP]VAR __MaxValue =[Trend WO number]RETURNIF (CALCULATE ( MIN ( DateTable[Date] ) ) = __MinDate,__MinValue,IF ( CALCULATE ( MAX ( DateTable[Date] ) ) = __MaxDate, __MaxValue, BLANK () ))
3 Replies
- amitchandak
Super User
TomaKavi , You can try window for cumulative function or with help from date table
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
Running Total/ Cumulative: https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=41
Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
- TomaKavi
Helper I
my problem is this measure, if I hardcode this value lets say on 1290 it works perfectly fine. So I need to remove all filters but keep the one used on plane
- TomaKavi
Helper I
I have already sorted it out. It was a need to remove a date filter only (for Trend WO number). everything else works just fine
Linear Line Plan =VAR __MinDate =[FirstDateWP]VAR __MinValue = 0VAR __MaxDate =[LastDateWP]VAR __MaxValue =[Trend WO number]RETURNIF (CALCULATE ( MIN ( DateTable[Date] ) ) = __MinDate,__MinValue,IF ( CALCULATE ( MAX ( DateTable[Date] ) ) = __MaxDate, __MaxValue, BLANK () ))