Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi! I'm rather new to Power BI and I'm not sure if this has been asked before. I looked in the forums and googled but I can't seem to find exactly what I need. I would be very grateful to anyone for any light shed on this.
My objective? To show the values (per hour) of the date selected on the slicer as well as the values (also per hour) of the date right before the date selected on the slicer.
So say given a sample dataset of random sales values:
Hour | Date | Sales |
1 | 8/8/2019 | 221 |
2 | 8/8/2019 | 293 |
3 | 8/8/2019 | 524 |
4 | 8/8/2019 | 742 |
⋮ | ⋮ | ⋮ |
1 | 8/9/2019 | 455 |
2 | 8/9/2019 | 505 |
3 | 8/9/2019 | 451 |
4 | 8/9/2019 | 484 |
⋮ | ⋮ | ⋮ |
1 | 8/10/2019 | 121 |
2 | 8/10/2019 | 780 |
3 | 8/10/2019 | 131 |
4 | 8/10/2019 | 722 |
⋮ | ⋮ | ⋮ |
20 | 8/12/2019 | 761 |
21 | 8/12/2019 | 396 |
22 | 8/12/2019 | 970 |
23 | 8/12/2019 | 285 |
24 | 8/12/2019 | 157 |
If I choose the date of 11-Aug-2019 on my slicer, it should present the data of both, like so:
With 8-Aug-2019 not having to be selected in the slicer.
I've tried several things, I've made measures where I've made the dates into an integer and made it so that when I choose the date on the slicer, it gives the selected date - 1.
Formulae are as follows:
I've also made sales values connected to these measures of day before and selected date:
Solved! Go to Solution.
Hi @Saabr
If you are looking to compare current vs previous days sales, you can use two measures below.
Sales Measure = SUM( 'Table'[Sales] )
Sales ( previous Day ) Measure = CALCULATE( SUM( 'Table'[Sales] ), PREVIOUSDAY( 'Table'[Date] ) )
This will give you the below result based on the provided dataset
Hi @Saabr
If you are looking to compare current vs previous days sales, you can use two measures below.
Sales Measure = SUM( 'Table'[Sales] )
Sales ( previous Day ) Measure = CALCULATE( SUM( 'Table'[Sales] ), PREVIOUSDAY( 'Table'[Date] ) )
This will give you the below result based on the provided dataset
Much Thank! I didn't know there was a prev function! Thank you!
Hi @Saabr
Are you looking to compare the current date to the previous one?
Also, what would you like to do with the 11th of Aug as it is not in your dataset?
User | Count |
---|---|
82 | |
76 | |
70 | |
69 | |
54 |
User | Count |
---|---|
105 | |
100 | |
91 | |
79 | |
68 |