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 All ,
Max Month Usages =
Var MaxMonthValue =
CALCULATE(
MAX('Date'[Year Month Number New]) ,
FILTER('Date',[UsagesCount] >= 1),
ALL('Date'))
RETURN
CALCULATE(
[Total Kwh],'Date'[Year Month Number New] = MaxMonthValue)
Max Month Usages -1 =
Var MaxMonthValue =
CALCULATE(
MAX('Date'[Year Month Number New]) -1 ,
FILTER('Date',[UsagesCount] >= 1),
ALL('Date'))
RETURN
CALCULATE(
[Total Kwh],'Date'[Year Month Number New] = MaxMonthValue)
UsagesCount = CALCULATE(COUNTROWS('Emporia Device Usage'))
These measures return the highest Months value ( the Max of the Months where there are usages ) by using the usages count Measure which works until i click or filter down onto a specfic month, The Max Month Usages -1 Then returns a blank value However Max Month usages works.
Desired outcome :
Have Max Month -1 return a value when filtered so the users can look at specfic seleted Months.
Max Usages -1 Example Data.pbix
Thanks , James.
Solved! Go to Solution.
Hi @JamesBurke,
Please check if this is what you're looking for:
I'm using this DAX formula:
Max Month Usages -1 =
Var MaxMonthValue =
CALCULATE(
MAX('Date'[Year Month Number]),
FILTER('Date',[UsagesCount] >= 1),
ALL('Date')) - 1
RETURN
CALCULATE(
[Total Kwh],
FILTER(
ALL('Date'),
'Date'[Year Month Number] = MaxMonthValue
)
)
Proud to be a Super User!
Hi,
if you want to select a date and based on that you want to show max month's value and previous months value, then I think ideally the month filter should be single select, as selecting multiple months and showing max month and previous month might be confusing I feel.
Now if your month is single select, then you can simply use below measures for Max month and Previous months value.
for Max month:
Hi @JamesBurke,
Please check if this is what you're looking for:
I'm using this DAX formula:
Max Month Usages -1 =
Var MaxMonthValue =
CALCULATE(
MAX('Date'[Year Month Number]),
FILTER('Date',[UsagesCount] >= 1),
ALL('Date')) - 1
RETURN
CALCULATE(
[Total Kwh],
FILTER(
ALL('Date'),
'Date'[Year Month Number] = MaxMonthValue
)
)
Proud to be a Super User!
You're welcome.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
109 | |
73 | |
54 | |
52 | |
44 |
User | Count |
---|---|
161 | |
112 | |
67 | |
60 | |
50 |