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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
carvalho
Frequent Visitor

Monthly target that changes according to the date slicer

Hello

 

I need help building a measure for targets.

I have an excel file with a list of sales people and their monthly targets. So it is easy to compare the sales in relation to target on a monthly basis. But, how can I build a measure that takes into account the selected period as well? So, when I change date slicer from 1 month to two months for example, the target measure will be also calculated as 2* target (etc)?

 

Thanks in advance.

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @carvalho ,

It depends a little bit on your case. In most Cases DISTINCTCOUNT() is what would serve your purpose. Lets say you work with a date table and you only show values from one year, then you could do something like:

 

DISTINCTCOUNT(DateTable[MonthColumn])

 

When you want to do calculation over multiple year and you have a separate data table then it is recommended to create another column which combines year and month (e.g. 2022-01, 2022,02 ...). Then you can use

 

DISTINCTCOUNT(DateTable[CombinedPeriod])

 

When you have a list of dates in a column and each value is the first or last date of a month (so only one value per period) then you could also do 

 

DISTINCTCOUNT(Table[PeriodColumn])

 

Look at my example for the second version, which I recommend to use (separate date table with year-month column):

 

Extract of my date table:

Mikelytics_0-1668325019056.png

Now I added the measure in a KPI card and a slicer for the selection

Mikelytics_1-1668325138568.png

 

Since you also have a plan value you can now add the the measure the plan value and you will get you result based on the selection of periods.

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

3 REPLIES 3
carvalho
Frequent Visitor

Thanks a lot! That helped.

Great and thank you for your feedback!

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @carvalho ,

It depends a little bit on your case. In most Cases DISTINCTCOUNT() is what would serve your purpose. Lets say you work with a date table and you only show values from one year, then you could do something like:

 

DISTINCTCOUNT(DateTable[MonthColumn])

 

When you want to do calculation over multiple year and you have a separate data table then it is recommended to create another column which combines year and month (e.g. 2022-01, 2022,02 ...). Then you can use

 

DISTINCTCOUNT(DateTable[CombinedPeriod])

 

When you have a list of dates in a column and each value is the first or last date of a month (so only one value per period) then you could also do 

 

DISTINCTCOUNT(Table[PeriodColumn])

 

Look at my example for the second version, which I recommend to use (separate date table with year-month column):

 

Extract of my date table:

Mikelytics_0-1668325019056.png

Now I added the measure in a KPI card and a slicer for the selection

Mikelytics_1-1668325138568.png

 

Since you also have a plan value you can now add the the measure the plan value and you will get you result based on the selection of periods.

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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