Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi there,
I am trying to write a SWITCH dax that allows me to filter a table of dates whenever I have "Previous Period" selected on a slicer.
I have a date column, and a measure:
Thanks in advance!!
Solved! Go to Solution.
Consider the following single measure:
Measure =
VAR _Current = Your calculation
VAR _Previous = Your calculation
RETURN
SWITCH (
SELECTEDVALUE ( 'Compare date Slicer'[Slicer Selection] ),
"Current Period", _Current,
"Previous Period", _Previous,
0
)
Proud to be a Super User! | |
Consider the following single measure:
Measure =
VAR _Current = Your calculation
VAR _Previous = Your calculation
RETURN
SWITCH (
SELECTEDVALUE ( 'Compare date Slicer'[Slicer Selection] ),
"Current Period", _Current,
"Previous Period", _Previous,
0
)
Proud to be a Super User! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
58 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
39 |