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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I try to calculate the last date from my dataset for the last month, the formula works :
Solved! Go to Solution.
Hi @Anonymous ,
Please update the formula of measure [Nb_devices_M-1] as below and check if it can return the correct result:
Nb_devices_M-1 =
VAR _lastdate = [Measure]
RETURN
CALCULATE (
DISTINCTCOUNT ( Inventory[ID] ),
FILTER ( Inventory, Inventory[History_Date] = _lastdate )
)
If the above one can't help you get the desired result, please provide some sample data in your table 'Inventory' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @Anonymous ,
Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.
Best Regards
Hi @Anonymous ,
Please update the formula of measure [Nb_devices_M-1] as below and check if it can return the correct result:
Nb_devices_M-1 =
VAR _lastdate = [Measure]
RETURN
CALCULATE (
DISTINCTCOUNT ( Inventory[ID] ),
FILTER ( Inventory, Inventory[History_Date] = _lastdate )
)
If the above one can't help you get the desired result, please provide some sample data in your table 'Inventory' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
@Anonymous , openingbalancemonth of the month gives the value of last date of last month
You have to use the date table joined with History_Date
calculate(DISTINCTCOUNT(Inventory[ID]), openingbalancemonth (Date[Date]))
or
calculate(lastnonblankvalues(Inventory[History_Date], DISTINCTCOUNT(Inventory[ID])), previousmonth(Date[Date]))
Power BI Allocating Targets: openingbalancemonth, openingbalancequarter, openingbalanceyear: https://youtu.be/6lzYOXI5wfo
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
4 | |
3 |