Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Aj24
Helper I
Helper I

difference of distinct id of previous period from current period

Hi everyone!

 

I'm looking to get the difference for the distinct count of ID’s of the current period from the previous period. 

table name 'test'

IDNameQuestionRatingMonthinitial datelast update monthmonthly bucketsprevious count for last period (jan 2021-mar 2021 current period)
A-yesAyesAmber1/10/20201/10/20201/01/2021Oct 2020-Dec 20201
A-yesAyesAmber1/01/20211/01/20211/02/2020Jan 2021-mar 2021 
A-yesAyesAmber1/02/20211/01/20211/02/2020Jan 2021-mar 2021 
B-possibleBpossibleAmber1/10/20201/01/20201/02/2020Oct 2020-Dec 2020 
B-possibleBpossibleAmber1/02/20211/01/20211/05/2021Jan 2020-mar 2020 
B-possibleBpossibleAmber1/05/20211/01/20211/05/2021Apr 2021-Jun 2021 
C-notCnotred1/03/20201/03/20201/04/2020Jan 2020-mar 2020 
C-notCnotred1/04/20201/03/20201/05/2020Apr 2020-Jun 2020 
C-notCnotAmber1/05/20201/05/20201/07/2020Apr 2020-Jun 2020 
C-notCnotAmber1/07/20201/05/20201/07/2020Jul 2020-Sep 2020 


So the scorecard visual count result would be: 1 

desired result: amber for (jan 2021-mar 2021 current period):
1

 

my custom quarters is split into this formula: custom Q&Y = IF('Test'[Month] = 1 && Test[Year] = 2020, "Jan-Mar 2020",

IF('Test'[Month] = 2 && Test[Year] = 2020, "Jan-Mar 2020",

IF('Test'[Month] = 3 && Test[Year] = 2020, "Jan-Mar 2020",

IF('Test'[Month] = 4 && Test[Year] = 2020, "Apr-Jun 2020")))) Etc

note: the months are broken into; Jan-Mar, Apr-Jun, Jul-Sep, Oct-Dec.

 

i've been using this formula but it didn't work: 

  • #current ID period = DISTINCTCOUNT(Test[ID])
  • #Previous ID period = Calculate(distinctcaoutn(test[ID]), Previousquarter(tarp[custom Q&Y])
  • #Period Difference of ID = VAR  _CurrentPeriodCount = #current ID period   VAR  _PrevPeriodIDCount = #Previous ID period     VAR   _Result = _CurrentPeriodCount  - _PrevPeriodIDCount          Return _Result

Many thanks in advance for sharing your expert help!

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi,  @Aj24 

Not very clear.It is difficult for me to understand your needs if you only provide unusable formulas.

Can you share expected result of  #current ID period,#Previous ID period ,#Period Difference of ID  in excel?

 

Based on the information you have provided so far, I suggest to try the following formula to create a calendar table first:

Calendar = CALENDARAUTO()
custom Q&Y = SWITCH(Calendar[Date].[QuarterNo],1,"Jan-Mar",2,"Apr-Jun",3,"Jul-Sep",4,"Oct-Dec")&"  "&Calendar[Date].[Year]
RanK Q&Y = RANKX('Calendar',Calendar[Date].[Year]*10+Calendar[Date].[QuarterNo],,ASC,Dense)

1.png

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.