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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dnsia
Helper II
Helper II

Create new table based on values of several columns

How do I create a new table that only shows the actual module names tagged as N in column In use.

Conditions:

 

1. If sublevel III has no value, sublevel II value should be listed

2. If sublevel II has no value, sublevel I value be listed.

3. If sublevel I has no value, module value should be listed.

 

 

Category Module  (Module) Sublevel I (Module) Sublevel II (Module) Sublevel III In Use
SETTINGS Application Configuration Accounts Configuration     Y
SETTINGS Masters Agency Master Agency Local Charges   N
SETTINGS Masters Documentation Masters MCN Configuration MCN Validation Y
Commercial Contribution Cost Masters Cost Type N
Commercial   Sales Visit Plan     N
Accounting Agency Commission Statement       N
Accounting Refund Payment       N
Operations Terminal Departure Receipt       N
Operations Reports Cont'r Weight Discrepancy     N

 

Desired Table :

 

Category Module Name In Use
SETTINGS Agency Local Charges N
Commercial Cost Type N
Commercial Sales Visit Plan N
Accounting Agency Commission Statement N
Accounting Refund Payment N
Operations Terminal Departure Receipt N
Operations Container Weight Discrepancy N

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @dnsia ,

 

You can create a new column in your current table with below code:-

Non_blank_module =
IF (
    Module_data[(Module) Sublevel III] <> BLANK (),
    Module_data[(Module) Sublevel III],
    IF (
        Module_data[(Module) Sublevel II] <> BLANK (),
        Module_data[(Module) Sublevel II],
        IF (
            Module_data[(Module) Sublevel I] <> BLANK (),
            Module_data[(Module) Sublevel I],
            Module_data[Module]
        )
    )
)

 

Samarth_18_0-1629359648522.png

Now you can use Category,Non_Blank_module,in user column from this table with IN-Use = N filter:-

Samarth_18_2-1629359875938.png

 

or you can create a new table with code:-

Table 3 =
SUMMARIZE (
    FILTER ( Module_data, Module_data[In Use] = "N" ),
    Module_data[Category],
    Module_data[Non_blank_module],
    Module_data[In Use]
)

Samarth_18_1-1629359723856.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @dnsia ,

 

You can create a new column in your current table with below code:-

Non_blank_module =
IF (
    Module_data[(Module) Sublevel III] <> BLANK (),
    Module_data[(Module) Sublevel III],
    IF (
        Module_data[(Module) Sublevel II] <> BLANK (),
        Module_data[(Module) Sublevel II],
        IF (
            Module_data[(Module) Sublevel I] <> BLANK (),
            Module_data[(Module) Sublevel I],
            Module_data[Module]
        )
    )
)

 

Samarth_18_0-1629359648522.png

Now you can use Category,Non_Blank_module,in user column from this table with IN-Use = N filter:-

Samarth_18_2-1629359875938.png

 

or you can create a new table with code:-

Table 3 =
SUMMARIZE (
    FILTER ( Module_data, Module_data[In Use] = "N" ),
    Module_data[Category],
    Module_data[Non_blank_module],
    Module_data[In Use]
)

Samarth_18_1-1629359723856.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

ryan_mayu
Super User
Super User

@dnsia 

you can either transform the table in pq or use DAX to create a new table.

pls see the attachment below.

 





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

Proud to be a Super User!




amitchandak
Super User
Super User

@dnsia , Unpivot the module column in power and filter on N and save and try

https://radacad.com/pivot-and-unpivot-with-power-bi

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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