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 everybody,
I'm doing a basic stacked column chart and I wanted to change the X-Axis (based on a date field) depending on a slicer (12 last months or 6 last months). This slicer will filter the Date X-Axis in order to show only 6 months or 12 months.
I've created a Table called "Temporalité" with 2 values. It's going to be a text slicer which function is to filter the Date Axis (Annuelle = 12 months and Semestrielle = 6 months)
DateDynamic =
var _MaxDate = CALCULATE(MAX(Table[Date]), ALL('Table'))
var _MinDate6 = EDATE(_MaxDate,-6)+1
var _MinDate12 = EDATE(_MaxDate,-12)+1
return
SWITCH(
TRUE(),
VALUES('pTemporalité'[Type de temporalité])="Annuelle" && MAX(Table[Date]) <= _MaxDate && MAX(Table[Date]) > _MinDate12, ??????????,
VALUES('pTemporalité'[Type de temporalité])="Semestrielle" && MAX(Table[Date]) <= _MaxDate && MAX(Table[Date]) > _MinDate6, ????????????,
BLANK())
I'm stuck with this problem...
I hope that somebody will help me!
Thank you
@DPE_Fabulous , if you select one month or date and then want to display a trend of 6 or 12 months you need a slicer on an independent date table
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Hi @amitchandak ,
It doesn't work for my issue because I use a lot of different slicers.
Here's a screenshot:
I need that I can change my variable with a slicer to change from _Min6 to _Min12, in order to change the number of TRUE in my list (which is becoming, afterwards, a range of date for my bar chart).
The aim is to keep only the "blue" one (Min6 and Min12 below):
P.S. In green, when I use the VAR in the return, it works. But not the VAR in the red rectangle. Why?
The error shown is: A table of multiple values was supplied when a single value was expected
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
89 | |
85 | |
73 | |
49 |
User | Count |
---|---|
169 | |
144 | |
90 | |
70 | |
58 |