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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

I have got Mass of some items in both kg & lbs, I wanted to create a 'Mass UoM' field for filters

Mass in Kg and Lbs is present in two separate columns. The Mass UoM filter should give user freedem to choose between Kg and Lbs so that further I can create a measure to display selected unit of mass only.

What logic should I apply to get this new calculated column?

 

 

@tamerj1 

2 ACCEPTED SOLUTIONS
littlemojopuppy
Community Champion
Community Champion

Hi @Anonymous 

You could accomplish this in either of two ways.

 

First, you could create a disconnected table that has "Kilograms (Kg)" and "Pounds (Lbs)" as its entries. Stick a slicer on the page with those values as the options.  Then write a measure that is a SWITCH statement for SELECTEDVALUE() of that table.  And use that measure in your visualizations.  This is the way you used to have to do this kind of thing.

 

OR...and I believe this will be much easier...look into field parameters.  They are in preview (last I heard) and I've never used them, but from what you said, they will probably get you where you want to be.  And should be easier to implement.

 

Hope this helps!

View solution in original post

changqing
Resolver II
Resolver II

Hi @Anonymous ,

 

You may consider using field parameters. You can parameterize the two fields here:

changqing_1-1660112896009.png

changqing_0-1660112829836.png

You can switch fields (axes/measures) at will. It is very useful!

changqing_2-1660113136505.png

The PBIX file is attached for reference.

PBIX file

Reference:

Let report readers use field parameters to change visuals (preview)

 

Best Regards,
changqing

View solution in original post

2 REPLIES 2
changqing
Resolver II
Resolver II

Hi @Anonymous ,

 

You may consider using field parameters. You can parameterize the two fields here:

changqing_1-1660112896009.png

changqing_0-1660112829836.png

You can switch fields (axes/measures) at will. It is very useful!

changqing_2-1660113136505.png

The PBIX file is attached for reference.

PBIX file

Reference:

Let report readers use field parameters to change visuals (preview)

 

Best Regards,
changqing

littlemojopuppy
Community Champion
Community Champion

Hi @Anonymous 

You could accomplish this in either of two ways.

 

First, you could create a disconnected table that has "Kilograms (Kg)" and "Pounds (Lbs)" as its entries. Stick a slicer on the page with those values as the options.  Then write a measure that is a SWITCH statement for SELECTEDVALUE() of that table.  And use that measure in your visualizations.  This is the way you used to have to do this kind of thing.

 

OR...and I believe this will be much easier...look into field parameters.  They are in preview (last I heard) and I've never used them, but from what you said, they will probably get you where you want to be.  And should be easier to implement.

 

Hope this helps!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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