Forum Discussion
Dynamic clustered column chart and single card, with a default month selected?
- Anonymous5 years ago
Hi WAB_Reports
Due to I don't know your data model, I build two sample tables to have a test.
Budget Table:
Add a YearMonth column in this table.
YearMonth = YEAR(Budget[Date])*100+MONTH(Budget[Date])Spend Table:
Add a YearMonth column in this table.
YearMonth = YEAR(Spend[Date])*100+MONTH(Spend[Date])Build a slicer by Budget[YearMonth] column and build measures to achieve your goal.
Spend = SUMX(FILTER(Spend,Spend[YearMonth]=MAX(Budget[YearMonth])),Spend[Spend])Total = VAR _Default = SUMX(FILTER(Spend,Spend[YearMonth] = YEAR(TODAY())*100+MONTH(TODAY())),Spend[Spend]) VAR _Select = SUMX(FILTER(Spend,Spend[YearMonth] = SELECTEDVALUE(Budget[YearMonth])),Spend[Spend]) Return IF(ISFILTERED(Budget[YearMonth]),_Select,_Default)Build a stacked column chart by Category column and Total measure.
Build a cluster column chart by Budget[Date], Spend measure and Budget column.
Result is as below.
By default, it will show values in current month.
Select YearMonth in slicer.
You can download the pbix file from this link: File
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi WAB_Reports
Due to I don't know your data model, I build two sample tables to have a test.
Budget Table:
Add a YearMonth column in this table.
YearMonth = YEAR(Budget[Date])*100+MONTH(Budget[Date])
Spend Table:
Add a YearMonth column in this table.
YearMonth = YEAR(Spend[Date])*100+MONTH(Spend[Date])
Build a slicer by Budget[YearMonth] column and build measures to achieve your goal.
Spend = SUMX(FILTER(Spend,Spend[YearMonth]=MAX(Budget[YearMonth])),Spend[Spend])Total =
VAR _Default = SUMX(FILTER(Spend,Spend[YearMonth] = YEAR(TODAY())*100+MONTH(TODAY())),Spend[Spend])
VAR _Select = SUMX(FILTER(Spend,Spend[YearMonth] = SELECTEDVALUE(Budget[YearMonth])),Spend[Spend])
Return
IF(ISFILTERED(Budget[YearMonth]),_Select,_Default)
Build a stacked column chart by Category column and Total measure.
Build a cluster column chart by Budget[Date], Spend measure and Budget column.
Result is as below.
By default, it will show values in current month.
Select YearMonth in slicer.
You can download the pbix file from this link: File
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rico! Thank you ever so much. I haven't had a chance to indepth check this just yet, but it does seem to be exactly what I'm looking for!