March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi community,
I built a data model that allows to analyze data regarding cost centers. Every cost center has a lifetime budget, i. e. it's not a monthly or yearly budget. Every month we track expenses, and the difference between the lifetime budget and the cumulative expenses is the remaining budget.
The data model has 14 million rows, and it starts April 1st 2006. The calculated numbers are correct and they show correctly in the corresponding periods. However, the lifetime budget shows for all periods (because it's not linked to any particular period).
The screenshot below shows this situation, obviously there's a lot of wasted space (and it looks terrible in Power BI charts)
Here's my question: How could I enforce that the measures "Lifetime Budget" and "Remaining Budget" are only displayed between the earliest and and the latest date of the "Expense" measure (in this example, between Q1-2019 and Q4-2020?
These are the measures:
Lifetime Budget :=
SUM ( FCC[FCC_Grant_Amount] )
Expense:=
CALCULATE (
SUM ( JournalEntries[Amount_] ),
JournalEntries[JE Entry Type] = "Posted",
LEFT ( JournalEntries[GL_Account], 1 ) = "2",
LEFT ( JournalEntries[GL_Account], 2 ) <> "21",
JournalEntries[GL_Account] <> "29900000",
FCC[Entity_Type] = "PI"
)
Cumulative Expense :=
CALCULATE (
SUM ( JournalEntries[Amount_] ),
JournalEntries[JE Entry Type] = "Posted",
LEFT ( JournalEntries[GL_Account], 1 ) = "2",
LEFT ( JournalEntries[GL_Account], 2 ) <> "21",
JournalEntries[GL_Account] <> "2122013",
JournalEntries[GL_Account] <> "21510701",
JournalEntries[GL_Account] <> "29900000",
FCC[Entity_Type] = "PI",
FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= MAX ( 'Date'[Date] ) )
)
Remaining Budget:=
IF (
[Grant Amount] = 0
|| ISBLANK ( [Grant Amount] ),
BLANK (),
[Grant Amount] + [Grant Cumulative Expense] + [Grant Commitments]
)
Thanks a lot for any input!
Solved! Go to Solution.
How about:
Show Lifetime Budget = IF(ISBLANK([Expense]), BLANK(), [Lifetime Budget]])
Show Remaining Budget = IF(ISBLANK([Expense]), BLANK(), [Remaining Budget]])
Proud to be a Super User!
Paul on Linkedin.
How about:
Show Lifetime Budget = IF(ISBLANK([Expense]), BLANK(), [Lifetime Budget]])
Show Remaining Budget = IF(ISBLANK([Expense]), BLANK(), [Remaining Budget]])
Proud to be a Super User!
Paul on Linkedin.
Thank you very much Paul, that did the trick! I had a trickier solution in mind (finding the first and the last date when there were actual expenses), but that's clearly an overkill here. Your suggestion works perfectly in both Excel and Power BI.
Much appreciated!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |