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
Hi everyone,
trying to compute a metric by hour of day, and compute the same number for 7 days ago.
My metric is :
Purchased (#) = CALCULATE(DISTINCTCOUNT(fact_purchased[id_product])
The metric for 7 days before is :
CALCULATE([Purchased (#)],
DATESINPERIOD ('dim_date'[Date],
max('dim_date'[Date])-7,-1,DAY))
I have a dim_date table and a dim_time table (hourly); data being groupped by date and start of hour in my fact tables
The screenshot i am sharing shows the data after a refresh that happened today (apr 18th) at 11 AM. The figures it is showing after 11 AM are not correct for previous week; which makes sens because there is no data point for apr 18th after 11.
Any idea of how i could display data for after 11 AM anyways ?
Thanks a lot
HI @Anonymous ,
You can consider to use date function to manually define filter date range to get correspond records:
Time Intelligence "The Hard Way" (TITHW)
Regards,
Xiaoxin Sheng
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 36 | |
| 29 | |
| 28 |
| User | Count |
|---|---|
| 127 | |
| 88 | |
| 78 | |
| 66 | |
| 65 |