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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Aidarbek
New Member

How to create a new table according the dates

Good day, everyone!
I'm new in PowerBI, could you please help me with this issue.

 

I have a table, like (template is made as actual table):

Org nameAmountDate
A      1 00001.01.2024
b      2 00001.02.2024
c      3 00001.03.2024
d      4 00001.04.2024
e      5 00001.05.2024
f      6 00001.06.2024
A      1 00001.07.2024
b      2 00001.08.2024
c      3 00001.09.2024
d      4 00001.10.2024
e      5 00001.11.2024
f      6 00001.12.2024

 

This table shows the information about payments, dates and which organization should make a payment.

I have to make a slicer (dropbox) with a reporting date, and create a table with 3 column.

Org name - Payment before the reporting date - payments after the reporting date

 

I used to try a different ways.

I used to try to use a slicer with a column in a original table, but it didn't work.

So I created new table with a list of Current dates possible (Sheet 1 (2)).

The last one I created a list as follow:

 
SummaryTable =
VAR Seldate=SELECTEDVALUE('Sheet1 (2)'[Current date])
 RETURN
SUMMARIZE(
    'Sheet1',
    'Sheet1'[Org name],
    "Amount Before Selected Date",
    CALCULATE(
        SUM('Sheet1'[Amount]),'Sheet1'[Date] < Seldate),
    "Amount After Selected Date",
    CALCULATE(
        SUM('Sheet1'[Amount]), 'Sheet1'[Date] > Seldate)
)
 
Also tried without VAR and insert as "<selectedvalue", but also failed.
 
Thank you!
 
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Aidarbek ,

 

this wont work, as calculated tables is not supposed to react on visual changes, like slicer selection.

View solution in original post

5 REPLIES 5
FreemanZ
Super User
Super User

hi @Aidarbek ,

 

this wont work, as calculated tables is not supposed to react on visual changes, like slicer selection.

ok, thank you for the information!

Will try to find other way!

hi @Aidarbek ,

 

yes, instead of write calculated table, try to write plot a table visual with existing columns and measures like below:

 

Amount After =

VAR Seldate=SELECTEDVALUE('Sheet1 (2)'[Current date])

VAR _result=

SUMX(

    FILTER(

       ALLSELECTED(Sheet1),

       Sheet1'[Date] > Seldate

    ),

    Sheet1[Amount]

)

RETURN _result

 

 

Amount Before =

VAR Seldate=SELECTEDVALUE('Sheet1 (2)'[Current date])

VAR _result=

SUMX(

    FILTER(

       ALLSELECTED(Sheet1),

       Sheet1'[Date] < Seldate

    ),

    Sheet1[Amount]

)

RETURN _result

 

bhanu_gautam
Super User
Super User

@Aidarbek , 

If you don't already have a date table, you can create one using DAX:

DateTable =
ADDCOLUMNS (
CALENDAR ( DATE ( 2024, 1, 1 ), DATE ( 2024, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Month", MONTH ( [Date] ),
"Day", DAY ( [Date] ),
"MonthName", FORMAT ( [Date], "MMMM" ),
"YearMonth", FORMAT ( [Date], "YYYY-MM" )
)

 

Add the Date column from the DateTable to a slicer in your report.

 

Create a Summary Table
Use the following DAX to create a summary table

SummaryTable =
VAR Seldate = SELECTEDVALUE('DateTable'[Date])
RETURN
SUMMARIZE(
'Sheet1',
'Sheet1'[Org name],
"Amount Before Selected Date",
CALCULATE(SUM('Sheet1'[Amount]), 'Sheet1'[Date] < Seldate),
"Amount After Selected Date",
CALCULATE(SUM('Sheet1'[Amount]), 'Sheet1'[Date] > Seldate)
)

 

Add a table visual to your report and use the SummaryTable to display the Org name, Amount Before Selected Date, and Amount After Selected Date.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






I can't understand why,  but all the amount accounted in one group:

 

Aidarbek_0-1732801807676.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.