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
Hello All,
I have 2 tables as shown below.
Months table: (MonthName is text)
TechSpend:
MonthName Text
Category Text
Year Text
Actuals Currency
TechSpend table has data for all 12 months of 2023 and 1st month of 2024.
Both tables are related using MonthName column. (Months table is on 1 side of Many:1).
On one of my report, I have a slicer on "Year" and trying to use a Measure to show "Highest MonthName - Total Actuals" in a card.
Solved! Go to Solution.
I agree with the above comment about creating a proper date table! However, below is a solution anyway.
----------------------------------------------------------------
Thank you all for quick responses!
Hi @usernj123 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Total Actuals =
VAR ActualExceptOther = ROUND(CALCULATE(sum(TechSpend[Actuals]), TechSpend[Category] <> "Other")/1000,2)
VAR _table= ADDCOLUMNS(ALL('TechSpend'),"monthnum",MONTH(CONVERT([MonthName]&" "&1,DATETIME)))
var MaxNum=MAXX(FILTER(_table,[Year] =SELECTEDVALUE('TechSpend'[Year])),[monthnum])
var MaxMonth=CALCULATE(MAX('Months'[MonthName]),FILTER(ALL('Months'),'Months'[MonthNumber]=MaxNum))
RETURN MaxMonth & " - " & ActualExceptOther & "K"
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I agree with the above comment about creating a proper date table! However, below is a solution anyway.
----------------------------------------------------------------
PLease consider using a proper Dates table instead. It will make your other calculations so much easier.
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 |
---|---|
94 | |
86 | |
82 | |
70 | |
49 |
User | Count |
---|---|
143 | |
122 | |
109 | |
60 | |
55 |