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
ignas
Advocate II
Advocate II

Dynamic column values based on selected date. Need help

Hello

 

I have this data:

 

Capture.PNG

 

I want to have a date parameter. If I choose 01-04-2018 date then it would mean that all dates before 01-04-2018 are actual and all dates from 01-04-2018 are forecast. It looks simple, but I cannot get it working.

 

 Please also have a look at my dashboard with data: https://mega.nz/#!LrpRnSwR!DU_Bir3jYPSU139nSPgsbRuTKsJCeqozj6eKDrAhzbo

 

Thanks a lot

 

Regards,

 

Ignas

 

 

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @ignas,

 

The solution could be as follows.

1. Create an independent date table. Don't establish relationships with other tables.

2. Create a slicer.

3. Create a measure like below.

Measure 9 =
VAR selectedDate =
    IF ( HASONEVALUE ( 'Table8'[Date] ), MIN ( 'Table8'[Date] ) )
RETURN
    IF ( MAX ( DimDate[Datekey] ) <= selectedDate, "Actual", "Forecast" )

Dynamic_column_values_based_on_selected_date_Need_help

 


Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @ignas,

 

The solution could be as follows.

1. Create an independent date table. Don't establish relationships with other tables.

2. Create a slicer.

3. Create a measure like below.

Measure 9 =
VAR selectedDate =
    IF ( HASONEVALUE ( 'Table8'[Date] ), MIN ( 'Table8'[Date] ) )
RETURN
    IF ( MAX ( DimDate[Datekey] ) <= selectedDate, "Actual", "Forecast" )

Dynamic_column_values_based_on_selected_date_Need_help

 


Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-jiascu-msft

 

It really works very well. Thank you a lot

I have one issue though. Then I try to visualize with a graph it is not possible to display Actual/Forecast column in the graph. Do you know where the problem can be? I cannot add to Legend this newly created column.

Capture.PNG

 

Here is a new file: https://mega.nz/#!emIj2Z4A!BtaDt9WFN5KTlMRbM8awLMsqyHPWl7uh0SEDGA_eYic

 

Thanks a lot


Regards,

 

Ignas

 

Hi Ignas,

 

I'm afraid we can't add a measure in the Legend. Actually, we don't need to do that in your scenario. Because every Axis value only has one Scenario. What't the result you expect?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-jiascu-msft

 

Thank you for the response.

Yes of course I need different colors:

Capture.PNG

We need to know when ACT finished and when BUD/FC starts.

 

Hi @ignas,

 

As a workaround, we can change the measure and put it in the field "Color saturation".

Scenario+ = 
    IF ( MAX ( DimDate[Datekey] ) <= IF ( HASONEVALUE ( 'Table8'[Date] ), MIN ( 'Table8'[Date] ),"Actual"), 1, 0 )

Dynamic_column_values_based_on_selected_date_Need_help2

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ignas
Advocate II
Advocate II

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.