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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to create parameters in Power BI

Hi,

 

Can you please help me create the following paramter in Power BI?

 

Left or Remained(Parameter)

 

Value                  Display As

1                         Left

2                         Remained

 

Compute By (Parameter)

Attribute

Total Population

 

 

And then converting the following calculated fields in Tableau to DAX:

 

Compute Filter

CASE [Compute By]

WHEN '1' THEN [% Across]

WHEN '2' THEN [% Down]

END

 

N

IF [Compute By] = '1' THEN COUNTD([Student Id]) ELSE NULL END

 

N ALANA

{ FIXED [ALANA] :COUNTD(IF [Resident - Show/Hide] THEN [Student Id] END)} + { FIXED [ALANA] :COUNTD(IF [Resident - Show/Hide] = FALSE THEN [Student Id] END)}

 

 

Thanks!

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You can do the first one you can use switch like

 

Switch(selectedvalues([Compute By]) ,
"1" , [% Across] ,
"2" , [% Down]
)

 

if (Max([Compute By]) = "1" , COUNTD([Student Id]) , blank())

 

or

if (selectedvalu([Compute By]) = "1" , COUNTD([Student Id]) , blank())

 

for fixed refer my video

LOD- FIXED (Level of Details): https://youtu.be/hU-cVOwDCvY

 

you need use allexcept using the fact/central table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit,

 

I am getting the following error message:

"The DISTINCTCOUNT function only accepts a column reference as an argument."

 

N ALANA = CALCULATEDISTINCTCOUNTIF (Sheet1[Resident - Show/Hide]Sheet1[Student Id]ALLEXCEPT(Sheet1Sheet1[ALANA]) ) ) )
&
CALCULATEDISTINCTCOUNTIF(Sheet1[Resident - Show/Hide] = "FALSE"Sheet1[Student Id]), ALLEXCEPT(Sheet1Sheet1[ALANA]) ) )
 

Thanks!

Anonymous
Not applicable

Hi  @Anonymous , 

 

The DISTINCTCOUNT function counts the number of distinct values in a column. There should be a column name in the function. You should create a formula like

N ALANA = CALCULATE(DISTINCTCOUNT( <column>, FILTER(<table>,<filter>))

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.