Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I am trying to calculate the sum of my optimal load qty (VAR a) for the previous 90days. I have the following formua but it does not seem to be filtering correctly for the date range:
PAR MAX Dispatch Qty P90D =
VAR a =
CALCULATE (
MINX ( TOPN ( 1, fact_PAR, [PAR Net Margin/Flight], DESC ), fact_PAR[Value] )
)
RETURN
SUMX (
SUMMARIZE (
'dim_perishable sell through',
'dim_perishable sell through'[Flight Key],
'dim_perishable sell through'[Item Name],
"PAR MAX value P90D",
CALCULATE (
a,
DATESINPERIOD ( dim_date[Date], LASTDATE ( dim_date[Date] ), -91, DAY )
)
),
[PAR MAX value P90D]
)
Can anyone please help?
Hi @ChristineB ,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Thank you but it is still not filtering on date range. It is calculating for just the selected date,
please share your sample pbix file, and then I can try to look into it.
thanks.
Unfortunately I don't have a sample pbix file to share. Is there any other information I could provide to assist?
I have a date table with a column dim_date[Date] with a 1:many relationship with a date column in my dim_perishable sell through[dep date].
There are no relationships with the fact_PAR table.
Hi,
I am not sure how your semantic model looks like, but try something like below whether it suits your requirement.
PAR MAX Dispatch Qty P90D =
SUMX (
SUMMARIZE (
'dim_perishable sell through',
'dim_perishable sell through'[Flight Key],
'dim_perishable sell through'[Item Name],
"PAR MAX value P90D",
CALCULATE (
MINX ( TOPN ( 1, fact_PAR, [PAR Net Margin/Flight], DESC ), fact_PAR[Value] ),
DATESINPERIOD ( dim_date[Date], LASTDATE ( dim_date[Date] ), -91, DAY )
)
),
[PAR MAX value P90D]
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |