Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
I am creating a measure to calculate a "% of total" taking in the context the date field, but it only works if the date field is in the same table as the other values, i.e., when I try to use the date field from my DimCalendar it won't work. What am I doing wrong? Is it the modelling or the DAX?
PBIX file avaliable in my OneDrive here.
This works:
% of year total =
VAR amount = [Expenses]
VAR TOT =
CALCULATE(
[Expenses],
ALLEXCEPT(English, English[Year]) // English[Year] is a redundant calc col
)
RETURN
IF(
SELECTEDVALUE(English[Year], "-") <> "-",
DIVIDE (amount , TOT, "Error"),
"Select a year"
)
This doesn't:
% of year total =
VAR amount = [Expenses]
VAR TOT =
CALCULATE(
[Expenses],
ALLEXCEPT(DimCalendar, DimCalendar[Year]) // This won't work
)
RETURN
IF(
SELECTEDVALUE(English[Year], "-") <> "-",
DIVIDE (amount , TOT, "Error"),
"Select a year"
)
Thanks in advance for any tip.
Solved! Go to Solution.
Hi @puneetvijwani ,
Thankss a lot for your support. You gave the insight I needed!
It worked with:
Hi @puneetvijwani ,
Thankss a lot for your support. You gave the insight I needed!
It worked with:
HI @jesus_rc try uing the below DAX
And use the Year column from DIm calender table in your Filter visual Instead of english table's year ; let me know if that works
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
15 | |
11 | |
11 | |
10 |