cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gauravnarchal
Post Prodigy
Post Prodigy

Current day sale vs the Previous day sale - KPI ticker by MAQ Software

Hello - I want to show the current day sale vs the previous day sale of all agents in the KPI ticker by MAQ Software visual.  I have created the below measure but is getting the incorrect results. Can you help me on this?

 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales], PREVIOUSDAY('Calendar Ultimate'[Date]))

 

Data is as below

 

Table 1

InvoiceIDInvoiceNumberAgentInvoiceDate
10961331009494162813-Nov-21
10958441843125174213-Nov-21
1095847184313150113-Nov-21
10958501843134175713-Nov-21
10960351843135175713-Nov-21
1095851184313650113-Nov-21
1096260184313750113-Nov-21
1095852184313850113-Nov-21
1095853184313950113-Nov-21
1095854184314050113-Nov-21
1095855184314150113-Nov-21
1095856184314250113-Nov-21
1095857184314350113-Nov-21
10958591843145166813-Nov-21
1095860184314650113-Nov-21
1095861184314750113-Nov-21
1095862184314850113-Nov-21
1095865184315050113-Nov-21
1095866184315150113-Nov-21
1095867184315250113-Nov-21
1095869184315450113-Nov-21
1095870184315550113-Nov-21
10958711843156174713-Nov-21
1095872184315750113-Nov-21
10958741843159174713-Nov-21
1095875184316050113-Nov-21
10958761843161174713-Nov-21
10958771843163174713-Nov-21
10958791843165166813-Nov-21
1095883184316750113-Nov-21
1095885184317050113-Nov-21
1095886184317150113-Nov-21
1095887184317250113-Nov-21
10958891843173166813-Nov-21
10958901843174166813-Nov-21
10958911843175166813-Nov-21
10958921843176174713-Nov-21
1095893184317750113-Nov-21
10960591843178174913-Nov-21
1095894184317950113-Nov-21
10960141843180174713-Nov-21
1095895184318150113-Nov-21
10959001843183174913-Nov-21
1095897184318450113-Nov-21
1095898184318550113-Nov-21
10959021843186174913-Nov-21
1095899184318950113-Nov-21
10959391843191166813-Nov-21
10959401843194166813-Nov-21
1095904184319550113-Nov-21
10959051843196174713-Nov-21
1095906184319750113-Nov-21
10959301843198175413-Nov-21
10959411843199175413-Nov-21
10959071843201174713-Nov-21
1095908184320250113-Nov-21
1095912184320350113-Nov-21
1095913184320450113-Nov-21
1095914184320550113-Nov-21
1095916184320750113-Nov-21
10959171843208174713-Nov-21
1095918184320950113-Nov-21
1095919184321050113-Nov-21
1095920184321150113-Nov-21
10960841843212174813-Nov-21
10962231843409171114-Nov-21
10962241843410171114-Nov-21
10962261843411162814-Nov-21
10962281843418795214-Nov-21
1096229184341950114-Nov-21
10962311843421795214-Nov-21
10962401843423158514-Nov-21
10962321843424158514-Nov-21
10962331843425165114-Nov-21
10962611843426161814-Nov-21
10962351843427248414-Nov-21
10962361843428158514-Nov-21
10962371843431158514-Nov-21
10962381843432160314-Nov-21
10962391843433172614-Nov-21
10962411843434163414-Nov-21
10962661843435175714-Nov-21
10962441843436171114-Nov-21
10962451843437163414-Nov-21

 

Table 2

 

InvoiceIDSale
10961331750.88
1095844740
10958475140
1095850120
10960353518.69
1095851250
1096260490
10958523360
10958531920
10958541980
10958551660
10958564000
10958571670
10958592014
1095860640
10958611670
1095862770
10958652580
10958661960
10958671980
10958695060
1095870970
10958711890
10958721190
10958741380
10958751900
10958761380
10958772010
1095879270
10958832060
10958853540
1095886850
1095887890
1095889150
1095890200
1095891100
10958924040
10958933710
1096059370
1095894660
10960145410
10958951100
10959002370
10958975720
10958981200
10959022166
10958991640
10959394500
109594016290
1095904990
10959053040
10959062050
10959301440
10959411645
109590728240
1095908500
1095912800
10959132630
10959142950
10959161670
10959171050
10959182420
10959191760
10959201530
10960841471.28
10962234020
1096224190
1096226200
109622813730
10962292510
10962311555
10962408950
109623222620
1096233860
10962611212
10962351640
10962363410
109623722620
109623817595
10962391005
10962411252
10962661560
1096244621.9
10962457875
2 ACCEPTED SOLUTIONS

I think you meant

Day Sales Today = CALCULATE ( [Total Sales], 'Calendar Ultimate'[Date] = TODAY () - 1 )

 

View solution in original post

corrected: 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales],'Calendar Ultimate'[Date] = Today()-1)

 

or this: 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales], 'Calendar Ultimate'[Date]  =PREVIOUSDAY(Today())





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
StefanoGrimaldi
Super User
Super User

try this: 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales], Today()-1)

 

or this: 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales], PREVIOUSDAY(Today())





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




I think you meant

Day Sales Today = CALCULATE ( [Total Sales], 'Calendar Ultimate'[Date] = TODAY () - 1 )

 

@StefanoGrimaldi - I'm getting an error

 

gauravnarchal_0-1636906805485.png

 

corrected: 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales],'Calendar Ultimate'[Date] = Today()-1)

 

or this: 

Day Sales Today = CALCULATE([Total Sales], 'Calendar Ultimate'[Date] = TODAY())

Day Sales Prev Day = CALCULATE([Total Sales], 'Calendar Ultimate'[Date]  =PREVIOUSDAY(Today())





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




my bad missed a part of the argument add befor the today or the privious day dax a Columna date = (today()-1) 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




@StefanoGrimaldi - In the second measure something is missing in the argument

 

gauravnarchal_0-1636907266748.png

 

Have you tried:

 

Day Sales Prev Day = CALCULATE([Total Sales], 'Calendar Ultimate'[Date]  =PREVIOUSDAY(Today())

 

?

 

This is what @StefanoGrimaldi told you above.

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!