cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sinanalmac Regular Visitor
Regular Visitor

Count month according to the measures

 Hi all, I 'm trying to create a measure with month  but this  shows a different value 

The calculations are the same between two tables but when I turn the table to a card it changes. I don't understand why?

 if you what  you can find the file in the link
https://www.dropbox.com/sh/rrcmf97oupdb3fr/AAAEW6-mDPVOjc6k5WBKS90ba?dl=0

count of value.png

Here is my calculation. they are also very simple. 

 
1- For targets : if the values are between  +- target values  it  types 1 

IF(AND('FORECAST BIAS'[BIAS]<MAX('Category Target'[ForecastBias Target]);'FORECAST BIAS'[BIAS]>(-MAX('Category Target'[ForecastBias Target])));1;0)
SUBCATTARGET = IF(AND('FORECAST BIAS'[BIAS]<MAX('SubcategoryTarget'[ForecastBias Target]);'FORECAST BIAS'[BIAS]>(-MAX('SubcategoryTarget'[ForecastBias Target])));1;0)
COUNTRY TARGET = IF(AND('FORECAST BIAS'[BIAS]<MAX('Country Target'[ForecastBias Target]);'FORECAST BIAS'[BIAS]>(-MAX('Country Target'[ForecastBias Target])));1;0)


2-Targets calcultion:  this code for  selection. It understands which filter is selected. 

CALCULATION TARGET = IF(ISBLANK(SELECTEDVALUE('FORECAST BIAS'[Category ]))=FALSE();IF(ISBLANK(SELECTEDVALUE('FORECAST BIAS'[SubCategory]))=FALSE();'FORECAST BIAS'[SUBCATTARGET];'FORECAST BIAS'[CATEGORYTARGET]);'FORECAST BIAS'[COUNTRY TARGET])

3- ad the last one : IF calculation target is 1 show then show  the month 

Measure 2 = CALCULATE(DISTINCTCOUNT('FORECAST BIAS'[ Month ]);FILTER('FORECAST BIAS';'FORECAST BIAS'[CALCULATION TARGET]=1))

I want to count how many months' values are one.

Thank you for helping me

Best Regards 
Sinan 

1 ACCEPTED SOLUTION

Accepted Solutions
themistoklis New Contributor
New Contributor

Re: Count month according to the measures

@sinanalmac

 

try this for measure2:

 

Measure 2 = CALCULATE(DISTINCTCOUNT('FORECAST BIAS'[ Month ]), FILTER(ALL('FORECAST BIAS'[ Month ]),'FORECAST BIAS'[CALCULATION TARGET]=1))
3 REPLIES 3
themistoklis New Contributor
New Contributor

Re: Count month according to the measures

@sinanalmac

 

try this for measure2:

 

Measure 2 = CALCULATE(DISTINCTCOUNT('FORECAST BIAS'[ Month ]), FILTER(ALL('FORECAST BIAS'[ Month ]),'FORECAST BIAS'[CALCULATION TARGET]=1))
sinanalmac Regular Visitor
Regular Visitor

Re: Count month according to the measures

Hi @themistoklis   ,

dude,  you are a life saver Thank you  so much .That's what I need Heart

Best regards

Sinan

Highlighted
sinanalmac Regular Visitor
Regular Visitor

Re: Count month according to the measures

 hi    @themistoklis
thank you  I wil check  it