Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
I have this table :
Date Sales
20/05/2023 400
27/10/2023 500
and I have a slicer that I can slice the data by year/quarter/date
My goal is when i select for example the first quarter of 2023 I should see 400 and when i select the first quarter of 2024 or the all year, I will see the 500.
If I select the third quarter of 2023 or Month 9 in 2023 I will see 400.
I slice the data by dim_date table and the sales in a fact table.
Thank you!
Thank you.
@Anonymous What's the rationale for why you want to see 400 even when the 20/5/2023 date is not included in the selected period? We need a specific rule that we can translate to Power BI in order for this to work.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
For this particular table I should receive data once every few months. That's why I want to spread the data and so I will see the last value that received even if I selected a month/quarter in which I did not received data.
@Anonymous I don't use this function often, but it may work here: LASTNONBLANKVALUE - DAX Guide
You'll need to filter for date, so maybe something like this might work:
[LastValue] =
VAR _dateSlicer = MAX( dimDate[Date] )
RETURN
CALCULATE(
LASTNONBLANKVALUE ( dimDate[Date], factTable[Sales] ),
FILTER( ALL( dimDate ),
dimDate[Date] <= _dateSlicer
)
)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |