Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I want to show a matrix table showing actuals if dates is smaller than e.g. 31 May 2025 then budget values if after this date
I was using this formula
FORECAST = IF(FIRSTDATE(Budget_data[Date]) <= DATE(2025,05,31),sum('PnL Data_2025'[Amount]),sum(Budget_data[Amount]))
but I now want the dashboard user to select a dates on the slicer instead of me hard coding the cut off date.
Hi @ILLANA_N,
Thank you for reaching out to the Microsoft fabric community forum.
Thank you so much @Jihwan_Kim, for sharing such a clear and practical solution really appreciate the effort you put into recreating the sample model and measure logic
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please Accept it as a solution so that other community members can find it easily.
Regards,
Harshitha.
Hi @ILLANA_N,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.
Thank you.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Expected result measure: =
VAR _selecteddate =
SELECTEDVALUE ( 'Calendar slicer'[date], DATE ( 2025, 5, 31 ) )
VAR _pnldata =
SUM ( 'PnL Data_2025'[amount] )
VAR _budget =
SUM ( Budget_data[amount] )
VAR _t =
ADDCOLUMNS (
VALUES ( 'Calendar'[date] ),
"@result",
IF (
'Calendar'[date] <= _selecteddate,
CALCULATE ( SUM ( 'PnL Data_2025'[amount] ) ),
CALCULATE ( SUM ( Budget_data[amount] ) )
)
)
RETURN
SUMX ( _t, [@result] )
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.
Schedule a short Teams meeting to discuss your question.
@ILLANA_N Create a date slicer in your Power BI report.
Use the SELECTEDVALUE function to get the date selected by the user.
DAX
FORECAST =
VAR SelectedDate = SELECTEDVALUE(DateTable[Date])
RETURN
IF(
SelectedDate <= DATE(2025, 05, 31),
SUM('PnL Data_2025'[Amount]),
SUM(Budget_data[Amount])
)
Proud to be a Super User! |
|
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |