Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello,
I have a table where unfortunately I can not figure out how to add 2 types of columns.
My base table has 2 version in columns, and some measure in rows.
This is the setup:
DAX for rows:
There is a setup for values switch to rows.
I want to add a difference column firsty in pp, but in this situation the simple difference option does not work with visual calculation. And I want to add another column which is a measure again, but I want to add this in cloumn and not in rows as the previous measures, because it is an impact of the difference, like this:
The green part is already done, a want to solve the yellow part of the table.
Can you help me?
Thank you in advance,
Evelin
Solved! Go to Solution.
Hi @Evelin_ - you can create the Difference (pp) measure
Difference_pp =
VAR CY = [CY selection]
VAR Base = [Base selection]
RETURN
FORMAT(CY - Base, "0.0") & " pp"
you want the impact to be a function of the pp difference and some weighting
Impact =
VAR pp = [CY selection] - [Base selection]
-- You can apply a custom logic here
-- e.g., multiply by a fixed factor, or lookup a weight from a table
RETURN
pp * [SomeWeight] -- Or a hardcoded number like 200
If the weight is fixed or based on the row context
Impact =
VAR pp = [CY selection] - [Base selection]
VAR impactFactor =
SWITCH(
SELECTEDVALUE('MetricsTable'[Metric]),
"Total", 200,
"Promo", 100,
"xx", 10,
0
)
RETURN
pp * impactFactor
Hope this helps.
Proud to be a Super User! | |
Hi @Evelin_ ,
I hope the information provided is helpful. Feel free to reach out if you have any further questions or would like to discuss this in more detail. If responses provided answers your question, please accept it as a solution so other community members with similar problems can find a solution faster.
Thank you!!
Hi @Evelin_ ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you!!
Hi @Evelin_ ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @rajendraongole1 for the prompt response.
May I ask if the provided solution helped in resolving the issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you!!
Hi @Evelin_ - you can create the Difference (pp) measure
Difference_pp =
VAR CY = [CY selection]
VAR Base = [Base selection]
RETURN
FORMAT(CY - Base, "0.0") & " pp"
you want the impact to be a function of the pp difference and some weighting
Impact =
VAR pp = [CY selection] - [Base selection]
-- You can apply a custom logic here
-- e.g., multiply by a fixed factor, or lookup a weight from a table
RETURN
pp * [SomeWeight] -- Or a hardcoded number like 200
If the weight is fixed or based on the row context
Impact =
VAR pp = [CY selection] - [Base selection]
VAR impactFactor =
SWITCH(
SELECTEDVALUE('MetricsTable'[Metric]),
"Total", 200,
"Promo", 100,
"xx", 10,
0
)
RETURN
pp * impactFactor
Hope this helps.
Proud to be a Super User! | |