cancel
Showing results 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

Frequent Visitor

Calculation to check if an entry is there for a particular category

Hi All,

Data

Account_Id, Program

1234, Program 1

1234, Program 2

1432, Program 1

1534, Program 3

The result should be a calculation for each of the programs which will just show a yes or no for that particular account.

Acct,  Program 1, Program 2, Program 3

1234, Yes, Yes, No

1432, Yes, No, No

1534, No, No, Yes

1555, No, No, No

Thanks,

1 ACCEPTED SOLUTION
Community Champion

A most straightforward solution is PQ,

``````let
Source = SourceT,
#"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[Program]), "Program", "Index", each if List.Count(_)>0 then "Yes" else "No")
in
#"Pivoted Column"``````

DAX measure can do the trick, but an extra dimension is necessary,

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! DAX is simple, but NOT EASY!
4 REPLIES 4
Community Champion

A most straightforward solution is PQ,

``````let
Source = SourceT,
#"Pivoted Column" = Table.Pivot(#"Added Index", List.Distinct(#"Added Index"[Program]), "Program", "Index", each if List.Count(_)>0 then "Yes" else "No")
in
#"Pivoted Column"``````

DAX measure can do the trick, but an extra dimension is necessary,

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! DAX is simple, but NOT EASY!
Frequent Visitor

I used the pivot table approach for my issue. Thanks !!

Super User

Hi @venus

New matrix, place the id on rows and program on columns. Then place this measure in the values

IF ( ISBLANK ( COUNTROWS ( TableName ) ), "False", "True" )

Community Champion

By your means, you'll get "True" cells but not even a single "False" due to auto-exist mechanism under the hood.

 Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! DAX is simple, but NOT EASY!

Announcements

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.

Power BI Monthly Update - June 2024

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

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors