Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have created a measure to display cumulative total using the guidelines on daxpatterns.com.
Measure:
Sales Acc = CALCULATE(Sales[SalesAmount];FILTER(ALL(Dates);Dates[Date]<=MAX(Dates[Date])))
My date table goes beyond the last sales date leaving me with a simple line chart, that visually doesn't work.
The question is:
How do I change the measure so I can get picture A instead of picture B? I would prefer not to set the filter manually on the visual, but let it be dynamic.
Data model
Picture A
Picture B
Solved! Go to Solution.
In your scenario, since your date table goes beyond the last sales date, so some date have no sales. So your get Picture B. If you want the expected reults, you need to filter out the dates which have no sales.
You need to create a column in your date table to check if the current date is before than the max date in your sales date.
Column = IF('Date'[DateKey]<MAX(Sales[DateID]),1,0)
Then add this column to your visual filter.
Regards,
Charlie Liao
Hi,
I think that instead of this
Sales Acc = CALCULATE(Sales[SalesAmount];FILTER(ALL(Dates);Dates[Date]<=MAX(Dates[Date])))
it should be
Sales Acc = CALCULATE(Sales[SalesAmount];FILTER(ALL(Dates);Dates[Date]<=MAX(Sales[SalesDate])))
you want the MAX of the SalesDate from the Sales Table.
In your scenario, since your date table goes beyond the last sales date, so some date have no sales. So your get Picture B. If you want the expected reults, you need to filter out the dates which have no sales.
You need to create a column in your date table to check if the current date is before than the max date in your sales date.
Column = IF('Date'[DateKey]<MAX(Sales[DateID]),1,0)
Then add this column to your visual filter.
Regards,
Charlie Liao
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
82 | |
57 | |
41 | |
39 |