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
PKPK90
Helper I
Helper I

Create table based on parameter value

Hi, I am trying to create table based on parameter value.

If parameter value is "*AllCustomers" then no filter to the table, but when Parameter value is different then filter by Parameter Value.

DEFINE

if (@customer = "*AllCustomers",

CALCULATETABLE (

 SUMMARIZECOLUMNS ( 'ItemBOMBlowout'[ProdCodeDesc]))

,

CALCULATETABLE (
    SUMMARIZECOLUMNS ( 'ItemBOMBlowout'[ProdCodeDesc]),
    'TotalOrderedByCustomer'[CustomerName] = @customer))

 

but it does't work, probably the syntax is wrong

1 REPLY 1
PKPK90
Helper I
Helper I

I also tried this one
DEFINE
var Tabl1_=
        CALCULATETABLE ( SUMMARIZECOLUMNS ( 'ItemBOMBlowout'[ProdCodeDesc] ) )
var Tabl2_=
        CALCULATETABLE (
            SUMMARIZECOLUMNS ( 'ItemBOMBlowout'[ProdCodeDesc] ),
            'TotalOrderedByCustomer'[CustomerName] = @customer
        )
        
      
RETURN 
IF(@customer = "*AllCustomers", Tabl1_, Tabl2_)   

 

The syntax for RETURN is incorrect

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.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors