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
Dunner2020
Post Prodigy
Post Prodigy

Representing measure in table

Hi there,

 

Here is a picture that I want to create in power BI:

 

leo_89_0-1619994421527.png

Now I got a table, which already contains column that has value H1,H2,.....H5 and a column that contains C1,C2,C3,C4. In the matrix, its simple count of H and C values and categorised into different categories such as "Almost Insignificant", "Almost Minor" etc. I am thinking to create measure for each type of categories. However, I am not how should I show measures in the same format as shown in the picutre. 

 

I am not sure whether my approach is right or not. Could anyone help me how can I represent my calculated measures into the same was as shown in the picture

 

Sample file can be download from here

1 ACCEPTED SOLUTION

Hi @Dunner2020 ,

 

For color formatting, you can try to create a measure and use it in conditional formatting like so:

 

Conditional formatting Measure =
VAR H_ =
    SELECTEDVALUE ( 'sde support_structure_evw'[AHI Score] )
VAR C_ =
    SELECTEDVALUE ( 'sde support_structure_evw'[Criticality zone] )
RETURN
    SWITCH (
        TRUE (),
        H_ = "H1"
            && C_ = "C1", "light blue",
        H_ = "H2"
            && C_ IN { "C1", "C2" }, "deepskyblue",
        H_ = "H3"
            && C_ IN { "C1", "C2", "C3" }, "dodgerblue",
        H_ = "H4"
            && C_ IN { "C1", "C2", "C3", "C4" }, "blue",
        "green"
    )

 

conditional formatting.PNG

Reference: Conditional table formatting in Power BI Desktop - Power BI | Microsoft Docs

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
AllisonKennedy
Super User
Super User

@Dunner2020  

 

Please see attached file (below signature) - you can set this up as Matrix visual. I would recommend created calculated columns in Power Query - so click Transform Data, then Add Column > Conditional Column. 

 

If criticality zone = C1 then ..... and enter the info you need to get the correct column headings. 

 

Repeat Add Column > Conditional Column for the H numbers as well. Then use these new columns in your matrix visual in place of the AHI and criticality zones. 

 

Do you need help with the color formatting too?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy , Thanks for the reply. Yes please, I need help in formatting too. 

Hi @Dunner2020 ,

 

Can the replies above solve your problem?

 

If they can, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If not, could you share us more details?

 

 

Best Regards,

Icey

Hi @Dunner2020 ,

 

For color formatting, you can try to create a measure and use it in conditional formatting like so:

 

Conditional formatting Measure =
VAR H_ =
    SELECTEDVALUE ( 'sde support_structure_evw'[AHI Score] )
VAR C_ =
    SELECTEDVALUE ( 'sde support_structure_evw'[Criticality zone] )
RETURN
    SWITCH (
        TRUE (),
        H_ = "H1"
            && C_ = "C1", "light blue",
        H_ = "H2"
            && C_ IN { "C1", "C2" }, "deepskyblue",
        H_ = "H3"
            && C_ IN { "C1", "C2", "C3" }, "dodgerblue",
        H_ = "H4"
            && C_ IN { "C1", "C2", "C3", "C4" }, "blue",
        "green"
    )

 

conditional formatting.PNG

Reference: Conditional table formatting in Power BI Desktop - Power BI | Microsoft Docs

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AllisonKennedy
Super User
Super User

Hi again @Dunner2020 

 

Can you please share a sample of what the data table looks like that you have to work with? We can't really help without knowing what that looks like and I'm a visual person, so I know you tried to desribe but in this case a table is worth a thousand words. 🙂 

 

Thanks!


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy , thanks for your reply. I have attached the sample file link in my original post. 

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.