Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all ,
I have table. I just want to do no matter which month I choose, It shows the calculated data of the previous month, I created month table and did this measure
TotalValuePreForeUSA =
var select=SELECETEDVALUES(FilterTable[MonthEn])
var test=SWITCH(Select,"Sep","Aug","Oct","Sep","Nov","Oct")
var test2= LOOKUPVALUE(FcTable[PreFcMonth], FcTable[MonthEn],VALUES(FilterTable[MonthEn]))
return
IF(VALUES(PYPF[Comp])="PY",
CALCULATE(sum(Finance[Value]),SAMEPERIODLASTYEAR(DimDate[Date]),Finance[Country]="USA"),
CALCULATE(SUM(Finance[Value]),Finance[ForecastMonth]=select,Finance[Country]="USA")
IF calculate(first one) was worked. but else calculate ( the second) was not worked.
finance table
Date year Moth Value Country
2019-01-01 2019 JAN 10 USA
2019-02-01 2019 FEB 20 USA
2019-03-01 2019 MAR 30 USA
2019-04-01 2019 APR 40 USA
2019-05-01 2019 MAY 50 USA
2019-06-01 2019 JUN 2132 USA
2019-07-01 2019 JUL 42 USA
2019-08-01 2019 AUG 952 USA
2019-09-01 2019 SEP 1107 USA
2019-10-01 2019 OCT 1262 USA
2019-11-01 2019 NOV 1417 USA
2019-12-01 2019 DEC 1572 USA
2018-01-01 2018 JAN 10 USA
2018-02-01 2018 FEB 20 USA
2018-03-01 2018 MAR 30 USA
2018-04-01 2018 APR 40 USA
2018-05-01 2018 MAY 50 USA
2018-06-01 2018 JUN 2132 USA
2018-07-01 2018 JUL 42 USA
2018-08-01 2018 AUG 952 USA
2018-09-01 2018 SEP 1107 USA
2018-10-01 2018 OCT 1262 USA
2018-11-01 2018 NOV 1417 USA
2018-12-01 2018 DEC 1572 USA
Filter table
MonthPrev MonthEn
JAN FEB
FEB MAR
MAR APR
APR MAY
MAY JUN
JUN JUL
JUL AUG
AUG SEP
SEP OCT
OCT NOV
NOV DEC
DEC JAN
I must be work but it didn't
is there any suggestion??
Best Regards
Sinan
Solved! Go to Solution.
Hi @Mariusz
Thank you for your attention. I solved the problem. I gave a number to each month's name and recalculated the Dax formula over this column. It showed the result that ı wanted to
Thanks Again
Best regards
Sinan
Hi @sinanalmac
Try this
Sum of Values Last Month =
CALCULATE(
[Sum of Values],
DATEADD( 'Table'[Date], -1, MONTH ),
ALL( 'Table' )
)
Thankyou
But My month name is text formmated.I just wanta Seleced the value Monthname(Text)= Monthname(Text)
CALCULATE(SUM(Finance[Value]),Finance[ForecastMonth]=select,Finance[Country]="USA")
Best regads
Sinan
Hi @sinanalmac
This Measure will return Previous Month isn't that what you were after?
Many thanks
Mariusz
Hi @Mariusz
Thank you for your attention. I solved the problem. I gave a number to each month's name and recalculated the Dax formula over this column. It showed the result that ı wanted to
Thanks Again
Best regards
Sinan
You are going to need an ALL in there somewhere in order to kick out of the current context and include all rows. Then you can filter down to the correct month and year that you want to display.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |