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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
rohit08
Regular Visitor

Interesting Dax Challenge

Hi Power BI Community

 

Happy New Year!

 

I need some suggestions on how to put DAX calculated measure when we have Actual at Date Level and then Forecast (without date) been appended in same table. The table name is Sales 

 

Below is the table structure showing sample records

 

rohit08_0-1673275807927.png

 

 

We need to create below view in Power BI where aggregated forecast value (by usinig combination of Country and Name) and shown next to rows for Actual data. It is expected that aggregated forecast value will repeat for every date. 

 

Please see below screenshot showing required view. Any code suggestions here for DAX to create measure for Forecast column here please?

 

rohit08_1-1673275839908.png

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1673276686487.png

 

Actual value measure: = 
SUM( Data[Actual Value] )

 

Forecast measure: =
IF (
    NOT ISBLANK ( [Actual value measure:] ) && HASONEVALUE ( Data[City] ),
    CALCULATE ( SUM ( Data[Forecast] ), REMOVEFILTERS ( Data[Date] ) )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1673276686487.png

 

Actual value measure: = 
SUM( Data[Actual Value] )

 

Forecast measure: =
IF (
    NOT ISBLANK ( [Actual value measure:] ) && HASONEVALUE ( Data[City] ),
    CALCULATE ( SUM ( Data[Forecast] ), REMOVEFILTERS ( Data[Date] ) )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.