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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
plmiquelon
Frequent Visitor

Create a table based on measured values

+Hi,

I would like to see if it would be possible to use values obtained from measure to create a table

plmiquelon_0-1648056253197.png

I want to create a table that has 2 column, one is date and second is cumulative cost. The table will have x rows, x being the total amount of day the project has (here its 21+43+67+224+30 = 385 days).

 

The date column starts on 08-NOV-2021, and adds a date for 385 days

The cumulative cost column goes as follow

for 21 days, add 34,65$ to the previous day

for 43 days, add 115,35$ to the previous day

for 67 days, add 185,61$ to the previous day,

for 224 days, add 437,51$ to the previous day

and for 30 days, add 262,40$ to the previous day.

 

This will serve as my planned project budget over the duration of the project. I would like to plot this against cumulative real cost that I have in another measure (that is no issue)

 

Is this something feasible within Power BI?

 

Thanks!

 

PL

 

 

 

1 ACCEPTED SOLUTION

You can apply any filters you need by wrapping the whole thing in a CALCULATETABLE call. You can see exactly which filters were applied to your table visual by using Performance Analyzer to get the DAX code used to generate the query for the table.

View solution in original post

3 REPLIES 3
plmiquelon
Frequent Visitor

Hi,

 

Thanks for your help.

 

My problem with this approach is that the table you see above is obtained using filter that are locally applied to specific projects. I'm not sure that the data will be maintained when creating a table

 

plmiquelon_0-1648124945082.png

 

Any toughts?

 

Thank you

 

You can apply any filters you need by wrapping the whole thing in a CALCULATETABLE call. You can see exactly which filters were applied to your table visual by using Performance Analyzer to get the DAX code used to generate the query for the table.

johnt75
Super User
Super User

You need a date table for this approach to work, you can create your table using

New Table = GENERATE( SELECTCOLUMNS('Table', "Start date", 'Table'[start date], "Days", 'Table'[num days], "Cost", 'Table'[Cost]),
DATESBETWEEN( 'Date'[Date], [Start date], [Start date] + [Days] - 1))

Then create a relationship between the new table and your date table. You can then create either a measure or a calculated column to show the cumulative cost. A measure would look something like

Cumulative Cost =
var maxDate = MAX('Date'[Date])
return CALCULATE( SUM('New Table'[Cost]), REMOVEFILTERS('Date'), 'Date'[Date] <= maxDate )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.