Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Help! I've been tried more suggestions from this community than I can count, including Greg Deckler's patterns, and still can't seem to get the correct total.
My fact table has project budgets by Month and Year. I've created measures for current and prior months, which work as expected regardless off the month selected in the slicer.
Now the business wants to see current month values where Prior Month = 0 so I wrote this measure:
NoPriorAmount = VAR prior = [PriorMoEACRev]
VAR currmon = [CurrEACRev]
RETURN IF(prior=0,[CurrEACRev],0)
Of couse the total row value is 0.
The measure will need to be sliced by a location and business unit dimensions. Any help would be greatly appreciated. See below for a table with sample data from the fact table, followed by my measures.
PriorMonEAC = CALCULATE(SUM(Bookings[eacrv]),DATEADD('Calendar'[Date],-1,MONTH))
CurrEAC = SUM(Bookings[eacrv])
NoPriorAmount = VAR prior = [PriorMoEACRev]
VAR currmon = [CurrEACRev]
RETURN IF(prior=0,[CurrEACRev],0)
Total New Bkgs = Total New Bkgs = VAR __table = SUMMARIZE('Services Lines',"__value",[New Bookings])
RETURN
IF(HASONEVALUE('Services Lines'[Line of Service]),[New Bookings],SUMX(__table,[__value]))
Solved! Go to Solution.
NoPriorAmount =
SUMX (
VALUES ( Project[Project] ),
VAR prior = [PriorMoEACRev]
VAR currmon = [CurrEACRev]
RETURN
IF ( prior = 0, [CurrEACRev], 0 )
)
NoPriorAmount =
SUMX (
VALUES ( Project[Project] ),
VAR prior = [PriorMoEACRev]
VAR currmon = [CurrEACRev]
RETURN
IF ( prior = 0, [CurrEACRev], 0 )
)
Thank you!! That works. Performance is slow, but the result is accurate. I'm marking this as the solution, although if anyone has recommendations to improve performance that would be helpful.
Hi @KBedor
Can you share the pbix?
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
26 | |
20 | |
19 | |
14 | |
13 |
User | Count |
---|---|
44 | |
36 | |
24 | |
24 | |
22 |