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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I want to show the number of orders made in the same period as a label in the same card.
For example: If 100 orders are made in the selected date range, I want to show how many orders were made -30 days retrospectively.
Sorry, Im a newbie and I couldn't get exactly how to do it. Any help will be appreciated 🙏
Hi @danidan
How do you get the number of orders in the selected period? Do you use Count on some column? Do you use a date slicer or filter to select a period?
Assume you select a continuous period with a slicer and you use Count on an Order ID column, you can try below measure to get the number of orders X days prior to the selected date range.
previous number =
VAR _minDate = MIN ( 'Table'[Date] )
VAR _maxDate = MAX ( 'Table'[Date] )
VAR _xDays = 30
RETURN
COUNTX (
FILTER (
ALL ( 'Table' ),
'Table'[Date] <= _maxDate - _xDays
&& 'Table'[Date] >= _minDate - _xDays
),
'Table'[Order ID]
)
If your table and model is not similar to my assumptions, please share some sample data and expected result to help us understand the requirement better.
Here is an old thread that gets sum of a column in the previous month with the same period. You could refer to its solutions and modify the start date and end date variables per your need.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Do you always want 30 days prior to the selected date range, or previous month?
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Here is a measure that shows one way to do it.
Prior 30 Days =
VAR mindate =
MIN( Data[DateCreated] )
RETURN
CALCULATE(
COUNT( Data[BuybackID] ),
FILTER(
ALL( Data[DateCreated] ),
Data[DateCreated] < mindate
&& Data[DateCreated] >= mindate - 30
)
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Added as Measure but there is no data inside
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!