Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello My Friends,
So I Have a DATASET like this:
ID DATE SALE
And This Dataset is fed a lot of times at the same day with new sales information.
So, What i wanna do is to Show The Sale that I Had 365 Days ago FROM TODAY inside a Card
I Also wanna show inside another Card the Sale that i HAD (365 -1) Day( Or D-1 Sale's)
So ,To show today's sale inside a card I Did:
Solved! Go to Solution.
The video was about how to build CORRECT data models. You should also learn how to correctly deal with dates. For this, please watch the following:
https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/
Your measures should be these (on condition the model is correct):
[Total Sales] = SUM( FactTable[Sales] )
[Today Sales] =
calculate(
[Total Sales],
'Calendar'[Date] = today()
)
[Today Sales 1Yr Ago] =
var __today =
calculatetable(
firstdate( 'Calendar'[Date] ),
'Calendar'[Date] = today()
)
return
calculate(
[Total Sales],
sameperiodlastyear(
__today
)
)
[Today Sales (1Yr - 1Day) Ago] =
var __todayPlusOneDay =
calculatetable(
firstdate( 'Calendar'[Date] ),
'Calendar'[Date] = today() + 1
)
return
calculate(
[Total Sales],
sameperiodlastyear(
__todayPlusOneDay
)
)
Bear in mind that the above will not work if Calendar is not a Date table in the model.
Best
D
Hi,
You can use the below measure,
The video was about how to build CORRECT data models. You should also learn how to correctly deal with dates. For this, please watch the following:
https://www.sqlbi.com/tv/time-intelligence-in-microsoft-power-bi/
Your measures should be these (on condition the model is correct):
[Total Sales] = SUM( FactTable[Sales] )
[Today Sales] =
calculate(
[Total Sales],
'Calendar'[Date] = today()
)
[Today Sales 1Yr Ago] =
var __today =
calculatetable(
firstdate( 'Calendar'[Date] ),
'Calendar'[Date] = today()
)
return
calculate(
[Total Sales],
sameperiodlastyear(
__today
)
)
[Today Sales (1Yr - 1Day) Ago] =
var __todayPlusOneDay =
calculatetable(
firstdate( 'Calendar'[Date] ),
'Calendar'[Date] = today() + 1
)
return
calculate(
[Total Sales],
sameperiodlastyear(
__todayPlusOneDay
)
)
Bear in mind that the above will not work if Calendar is not a Date table in the model.
Best
D
Darlove,
thanks for the anwser...
I may be wrong but I did no see anything related in the video you sent me....
User | Count |
---|---|
47 | |
26 | |
22 | |
17 | |
15 |
User | Count |
---|---|
55 | |
34 | |
18 | |
17 | |
15 |