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
I would like to show a measure based on end of the month’s value from one table minus today's value in another
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
Here is my sample data (Today is 2024.7.24):
Use this DAX to create a measure:
Difference =
VAR _PreviousMonthEndDay = EOMONTH(TODAY(), -1)
VAR _PreviousMonthValue =
CALCULATE(
SUM('Table (2)'[Value]),
'Table (2)'[Date] = _PreviousMonthEndDay
)
VAR _TodayValue =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = TODAY()
)
RETURN
_PreviousMonthValue - _TodayValue
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Here is my sample data (Today is 2024.7.24):
Use this DAX to create a measure:
Difference =
VAR _PreviousMonthEndDay = EOMONTH(TODAY(), -1)
VAR _PreviousMonthValue =
CALCULATE(
SUM('Table (2)'[Value]),
'Table (2)'[Date] = _PreviousMonthEndDay
)
VAR _TodayValue =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = TODAY()
)
RETURN
_PreviousMonthValue - _TodayValue
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Do you want a MEASURE? Measures are written in DAX, this is the Power Query forum and PQ uses the M language, not DAX. PQ does not create measures.
Please provide some sample data (in a file, not an image) and an example of the desired result.
Regards
Phil
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |