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
I have a table that contains sales informations. each sales id contains a product with quantities. the data is historized thanks to a column containing the dates (note that this column in an integer and not date column).
What I want is a table that will show the difference between today and yesterday. Like this :
The date is from a live connection. How can I do this using DAX ?
thanks
Solved! Go to Solution.
Hi @Broly ,
you can try this measure
Measure =
VAR _CurrentProduct = SELECTEDVALUE('Facts35'[Product ID])
VAR _CurrentDate = SELECTEDVALUE('Facts35'[Date as integer])
VAR _PreviousRow =
CALCULATE(
SUM('Facts35'[Quantity]),
FILTER(
ALL('Facts35'),
'Facts35'[Product ID] = _CurrentProduct && 'Facts35'[Date as integer] = _CurrentDate - 1
)
)
RETURN
SELECTEDVALUE('Facts35'[Quantity]) - _PreviousRowIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Broly ,
you can try this measure
Measure =
VAR _CurrentProduct = SELECTEDVALUE('Facts35'[Product ID])
VAR _CurrentDate = SELECTEDVALUE('Facts35'[Date as integer])
VAR _PreviousRow =
CALCULATE(
SUM('Facts35'[Quantity]),
FILTER(
ALL('Facts35'),
'Facts35'[Product ID] = _CurrentProduct && 'Facts35'[Date as integer] = _CurrentDate - 1
)
)
RETURN
SELECTEDVALUE('Facts35'[Quantity]) - _PreviousRowIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 44 | |
| 40 | |
| 29 | |
| 19 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 70 | |
| 53 |