Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello, I'm trying to do a report (Sample PBIX ) for a project. The spent is the actual column, the old baseline is the blue line and the new baseline is the orange line.
I need to hide in the chart, the highlighted part of the orange line, basically, the line before a date which is where we need it to be shown.
I'm using this measure but if I filter it with the previous dates it will not work properly and show no cummulative data, only the data from the starting month and onwards.
New Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(Sheet1,Sheet1[Month]<=MAX(Sheet1[Month])),Sheet1[Record Type]="New Baseline")
Solved! Go to Solution.
Hello @sebabordon ,
First, create a slicer table as follows:
Slicer table = VALUES(Sheet1[Month])
Next, create 2 measures as follows:
New Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(Sheet1,Sheet1[Month]>=SELECTEDVALUE('Slicer table'[Month])),Sheet1[Record Type]="New Baseline")Old Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(Sheet1,Sheet1[Month]<=SELECTEDVALUE('Slicer table'[Month])),Sheet1[Record Type]="Old Baseline")
And you'll see:
For the related .pbix file, see attachment pls.
@Anonymous , I such case prefer date. Or month year in YYYYMM format
New Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(allselected(Sheet1),Sheet1[Date]<=MAX(Sheet1[Date])),Sheet1[Record Type]="New Baseline")
best is you use a date table or month date , joined with this table
New Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(allselected(Date),Date[Date]<=MAX(Date[Date])),Sheet1[Record Type]="New Baseline")
I just did that with a calendar table and it seems to work using the measure below, nevertheless using the same concepts to create the measure on my original table produces incorrect output. ;(
New Baseline = CALCULATE(sUM(Sheet1[Amount]),Sheet1[Month]>=DATE("2020","09","30"),FILTER(Sheet1,Sheet1[Month]<=MAX(Sheet1[Month])),Sheet1[Record Type]="New Baseline")
Hello @sebabordon ,
First, create a slicer table as follows:
Slicer table = VALUES(Sheet1[Month])
Next, create 2 measures as follows:
New Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(Sheet1,Sheet1[Month]>=SELECTEDVALUE('Slicer table'[Month])),Sheet1[Record Type]="New Baseline")Old Baseline = CALCULATE(sUM(Sheet1[Amount]),FILTER(Sheet1,Sheet1[Month]<=SELECTEDVALUE('Slicer table'[Month])),Sheet1[Record Type]="Old Baseline")
And you'll see:
For the related .pbix file, see attachment pls.
Thanks for the solution!, I've ended touching the data (since already had a plan to do it), but this works properly as an alternate option. I'll save it for the future.
P.S. I Do not understand why the posts are translated to spanish...
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |