Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
I'm new to PowerBI & DAX and am struggling with creating a variation on a comparison of insurance products premiums for last 12 months agains prior 12 months. I've managed to create the LTM and PTM measures and this works for the insurer selected in a page slicer. The issue I have is that when certain insurers are selected I need to add back premiums for some products from a different insurer. Something like:
If insurer A is selected then show LTM and PTM allocated to A
If Insurer B is selected then show LTM and PTM allocated to B plus LTM and PTM for A but only for products 1 and 2
I'm trying to do this with measures to calculate the individual amounts and then with a SWITCH( TRUE(), measure. This works for the total, but it also adds to each row throwing those figures out. I'd appreciate if anyone can help me find a way to add only to the relevent product rows.
Here are my SWITCH( TRUE() formula and the table
Total including variations =
SWITCH( TRUE(),
[Selected Insurer] = "Insurer A", [Total Premium] + [Insurer C Accident & Health Premium] + [Insurer C Professional Risks Premium],
[Selected Insurer] = "Insurer B", [Total Premium] + [Insurer C Marine Premium],
[Total Premium)
Solved! Go to Solution.
Hi @MarkEden ,
According to your description, in my understanding, you want for example for Insurer B, only when the Risk Class row is Marine, it should be "[Total Premium] + [Insurer C Marine Premium]", otherwise, it should be "[Total Premium]".
If this is the case, here's my solution.
Total including variations =
SWITCH (
TRUE (),
[Selected Insurer] = "Insurer A",
[Total Premium] + [Insurer C Accident & Health Premium] + [Insurer C Professional Risks Premium],
[Selected Insurer] = "Insurer B",
IF (
MAX ( [Risk Class] ) = "Marine",
[Total Premium] + [Insurer C Marine Premium],
[Total Premium]
),
[Total Premium]
)
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MarkEden ,
Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team _ kalyj
It is. Many thanks for your help.
@v-yanjiang-msft thanks for this. I'll test this out. I think it might need a couple more variations but I can see the logic now.
Hi @MarkEden ,
According to your description, in my understanding, you want for example for Insurer B, only when the Risk Class row is Marine, it should be "[Total Premium] + [Insurer C Marine Premium]", otherwise, it should be "[Total Premium]".
If this is the case, here's my solution.
Total including variations =
SWITCH (
TRUE (),
[Selected Insurer] = "Insurer A",
[Total Premium] + [Insurer C Accident & Health Premium] + [Insurer C Professional Risks Premium],
[Selected Insurer] = "Insurer B",
IF (
MAX ( [Risk Class] ) = "Marine",
[Total Premium] + [Insurer C Marine Premium],
[Total Premium]
),
[Total Premium]
)
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |