The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone,
I have multiple tables in my model that contain binary values or codes that need to be translated to a corresponding label. For example, I have a client table, where the type can be 0 or 1, which means "Loyal" and "Other", or a country table where if the value is 1, it's France, if 2, it's England, 3 is Germany, etc.
I have a table that I want to use to transcore these values that looks like this :
Entity | Code | Label |
Client | 0 | Other |
Client | 1 | Loyal |
Country | 1 | France |
Country | 2 | England |
... | ... | ... |
My goal was to join the transcoding table to my other tables on the code, with the condition that the entity is the right name. In SQL, I would type :
select Label from transcode
where transcode.Code = Client.client_type
and transcode.Entity = "Client";
But I don't know how to achieve this in Power BI so that I can use labels instead of the codes in each table to build my report.
Thank you all !
@Lausaurine , we will join these two tables on code and cliend type and create one measure and use that with label in table visual
calculate(COunt(transcode[Label]), filter(transcode, transcode[Entity] = "Client" ))
refer if needed
DAX vs SQL: https://www.youtube.com/watch?v=WlvQ_SGy4iA&list=PLPaNVDMhUXGZNyKU0PgG2g3P0c6CPjMnj
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |