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 tried with a column with this sintax
column = if( table[date] >= max(table[date]) -10 , sales)
with this column i can show static data, i need to replace the max(table[date]) to selectedvalue(table[date]) in order to can show dinamic data in my chart.
thanks in advanced.
leave my dashboard with data here https://1drv.ms/u/s!AtEkAF7ffIsqg8RWv84QIBUlFwYLkg?e=hE4NTt
Solved! Go to Solution.
Hi @kevderbeste ,
I created a sample table as below:
First create a slicer table using below dax expression:
Slicer = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
Then create a measure as below:
Measure = IF(SELECTEDVALUE('Slicer'[Date])=BLANK(),SUM('Table'[Sales]),IF(MAX('Table'[Date])>=SELECTEDVALUE('Slicer'[Date])-10&&MAX('Table'[Date])<=SELECTEDVALUE('Slicer'[Date]),SUM('Table'[Sales]),BLANK()))
Finally you will see:(If no date is selected)
if one date is selected:
For the related .pbix file,pls click here.
@kevderbeste , not very clear
You can get 10 days back sales like
10 Days behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd(Table[Date],-10,Day))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
hi @amitchandak thanks for the information, is not the solution for my request, cause i need to show the dates in x axis, and with this mesaure i have an acumulated from data, and went i put this measure in line chart 1. show all dates and 2. if i selected a date just show one date, and i need to see 10 days back to selected.
thanks!
Hi @kevderbeste ,
I created a sample table as below:
First create a slicer table using below dax expression:
Slicer = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))
Then create a measure as below:
Measure = IF(SELECTEDVALUE('Slicer'[Date])=BLANK(),SUM('Table'[Sales]),IF(MAX('Table'[Date])>=SELECTEDVALUE('Slicer'[Date])-10&&MAX('Table'[Date])<=SELECTEDVALUE('Slicer'[Date]),SUM('Table'[Sales]),BLANK()))
Finally you will see:(If no date is selected)
if one date is selected:
For the related .pbix file,pls click here.
hI @v-kelly-msft THANKS SO MUCH FOR THIS! I'm happy for still learning from people like you.
For future checkers is importan to say, is not necessary any relatio between the tables.
THANKS AND REGARDS!!!
Hi @kevderbeste ,
What are you trying to do ?
Sum of 10 days before the date for each date in chart ?
Ricardo
hi @camargos88 , thats right, sum for each day, always showing 10 days back to selected day in date.
thanks!
Do you want to select a date using slicer and show 10 days back ?
Ricardo
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 |
---|---|
105 | |
96 | |
79 | |
66 | |
62 |
User | Count |
---|---|
145 | |
113 | |
105 | |
85 | |
65 |