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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
EndriuBlack
Frequent Visitor

My measure doesn't calculate well

Hello,

I have got this problem, 

I'm fighting with this issue for few days and I decided to ask The Community couse I don't understand the problem.

 

So,

I try to count number of industries that have two characteristics,

My measure looks like this:

 

Liczba firm wg par CD v2 =
     VAR paramWP = 'Param WP v2'[Wartość Param WP v2]
     VAR paramKO = 'Param vAdC konkur'[Wartość Param vAdC konkur]
     VAR Result =
CALCULATE( [Liczba firm CD],
   FILTER(
       ADDCOLUMNS( VALUES(Adreal_Dzienne[Właściciel marki]),
               "vAdC wybrana Grupa", [vAdC new KO],
               "vAdC WP kol", [vAdC WP] ),
       [vAdC wybrana Grupa] >= paramKO && [vAdC WP kol] <= paramWP )
)

Return Result
 ....
where calculated 
[Liczba firm CD] = COUNTROWS(VALUES(Adreal_Dzienne[Właściciel marki] ) )
Adreal_Dzienne[Właściciel marki] is a column with name of the industries
 
[vAdC new KO] is a measure calculating SUM of some data
[vAdC WP] is another measure also calculating SUM of some data

I have created two parameters and I want my measure to calculate only number of firms that are within this parameters:
FILTER(
       ADDCOLUMNS( VALUES(Adreal_Dzienne[Właściciel marki]),
               "vAdC wybrana Grupa", [vAdC new KO],
               "vAdC WP kol", [vAdC WP] ),
       [vAdC wybrana Grupa] >= paramKO && [vAdC WP kol] <= paramWP )
)
 
The number of firms that are in result of my measure is too big and it looks like it doesn't take in calculation this part: && [vAdC WP kol] <= paramWP, but maybe the measure isn't written correctly at all.
I have checked and when the Result was only VARs: paramWP i paramKO the values are just like I have selected. Maybe I wrongly write the sum of two conditions and it should be created differently not like this: [vAdC wybrana Grupa] >= paramKO && [vAdC WP kol] <= paramWP?
Or two parameters as conditions are not possible to use?

Maybe someone have an idea and will find a way to help me 🙂
 
bestregards
Andrzej
 
 
3 REPLIES 3
jgeddes
Super User
Super User

If you change your VAR Result to 

VAR Result =
COUNTROWS(
FILTER(
SUMMARIZE(
Adreal_Dzienne,
Adreal_Dzienne[Właściciel marki]
"vAdC wybrana Grupa"[vAdC new KO],
 "AdC WP kol"[vAdC WP] 
),
[vAdC wybrana Grupa] >= paramKO && [vAdC WP kol] <= paramWP 
)
)

does that get you the result you are looking for?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hey, thanks but unfortunatly it gives me the same result as in my solution 😞
it looks like it doesn't take the 

&& [vAdC WP kol] <= paramWP 
condition into calculation 😞

I will try to put it into SWICH ( TRUE () ) logic and then count rows of the result.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors