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.
I have 2 table visualisations showing data for 2018 and one slicer which contains the month of the year.
I'd like this month slicer to control both table visualisations. However I want one table to show data for the month selected in the slicer and I want the other table to show data YTD (so filter the data where the date is less than or equal to the month selected in the slicer).
The first table is easy to acheive, it's the YTD table I am struggling with. Any suggestions would be appreciated.
Solved! Go to Solution.
@tommuirwebb - It would be preferable to have a Date table, because it enables you to use Time Intelligence functions.
However, if you only have month names to join the tables, you could:
Value YTD =
var _selected_month = SELECTEDVALUE(MonthTable[MonthKey])
return CALCULATE(
SUM(YourTable[YourValue],
MonthTable[MonthKey] <= _selected_month
)
Can you create a month table like this and then use the dates based on month selection to control same
MonthTable =
var FullCalendar = ADDCOLUMNS(CALENDAR("2016/1/1","2017/12/31"),"Month Number",MONTH([Date]),"Year",YEAR([Date]),"Year-Month",LEFT(FORMAT([Date],"yyyyMMdd"),6),"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
return
SUMMARIZE(FullCalendar,[Month Number],[Year],[Year-Month],[Year-MonthName])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
@tommuirwebb - It would be preferable to have a Date table, because it enables you to use Time Intelligence functions.
However, if you only have month names to join the tables, you could:
Value YTD =
var _selected_month = SELECTEDVALUE(MonthTable[MonthKey])
return CALCULATE(
SUM(YourTable[YourValue],
MonthTable[MonthKey] <= _selected_month
)
Thanks @Anonymous. I was able to get the desired results using a sepearate calendar table (with no relationships to any other tables) and using this table for the slicer. Then using your Value YTD measure I was able to sum the values appropriately.
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 |
---|---|
107 | |
98 | |
78 | |
65 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |