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 all
When User selected the days, the table show this days data plus after 5 days data, is it possible to do that ?
for example : user selected 5th April, the table will show the data from 5th April to 12rd April.
do I use SQL Command to do that ?
philip
Hello @TTCF ,
Using SQL:
SELECT sum_data
FROM table_name
WHERE date BETWEEN selectvaluedate AND selectvaluedate +7;
Use the DAX function:
According to your description, I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
var _select =SELECTEDVALUE('Table'[Date])
var _1=
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Date]>=_select&&'Table'[Date]<=_select+7))
return _1
2. Result.
You can download the PBIX file from here.
If my answer isn't what you need, can you share sample data and sample output in table format? Or a sample of pbix after deleting sensitive data.
Best regards
Liu Yang
If this post helps,then consider Accepting it as the solution to help other members find it faster.
@Anonymous Yes this is possible, do you have sample data? Do you have a DimDate table? You can create another table that is not related to your data, and then use DAX. See if this post helps get you what you want: https://blog.enterprisedna.co/show-days-before-or-after-a-selected-date-using-power-bi/
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |