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,
I'm looking to create a dropdown date filter with choices like ;
Last 7 days
Last 2 weeks
Last month
...and so on
This will act like a date filter on respective visuals. Please let me know if this is possible in PowerBI
.
Solved! Go to Solution.
Hi @Anonymous
You can create several measures list the
Last 7 days
Last 2 weeks
Last month
...and so on
and then try something like this:
Final Value 1 = IF(HASONEFILTER(Table[slicer]), SWITCH(SELECTEDVALUE(Table[slicer]), "Last 7 days", [Measure 1], "Last 2 weeks", [Measure 2], "Last month", [Measure 3] ), BLANK() )
here're also other similar threads could be your reference:
https://community.powerbi.com/t5/Desktop/Control-Range-Date-by-Dropdown-filter/m-p/977818
Hi @Anonymous
You can create several measures list the
Last 7 days
Last 2 weeks
Last month
...and so on
and then try something like this:
Final Value 1 = IF(HASONEFILTER(Table[slicer]), SWITCH(SELECTEDVALUE(Table[slicer]), "Last 7 days", [Measure 1], "Last 2 weeks", [Measure 2], "Last month", [Measure 3] ), BLANK() )
here're also other similar threads could be your reference:
https://community.powerbi.com/t5/Desktop/Control-Range-Date-by-Dropdown-filter/m-p/977818
Hi @Anonymous ,
Believe that you need to create a auxiliar table with the information and then make a switch measure to filter out your information something similar to:
ID | Type | Period | Type of Period |
1 | Last Week | 7 | Day |
2 | Last 2 Weeks | 7 | Day |
3 | Last Month | 1 | Month |
Then make a formula similar to:
Measure =
CALCULATE (
[Measure],
SWITCH (
SELECTEDVALUE ( Table[ID] ),
1, FILTER (
ALL ( DateTable ),
DateTable[Date] <= MAX ( DateTable[Date] )
&& DateTable[Date] <= DATEADD ( DateTable[Date], - MAX ( Table[Period] ), DAY ),
2, .....
)
)
)
So you can dinamically add dates.
If you want some more details can you please share a sample data?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |