Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
From a table I am selecting the MAX(Value) to be shown in a Card-Visual.
I would like to use this value to check in a IF-THEN-ELSE-Kind of functionality to return a plain text like 'High', 'Medium', 'Low'.
This plain text should be used to perform LOOKUP on a different table to get additonal data.
Is there a way to get this kind of interdependency running?
Ia m actually not yet familiar with writing / using DAX-functions
Appreciating your input.
thx in advance
Thomas
Solved! Go to Solution.
Hey @thomasreick ,
sure, that's possible.
Try the following:
MyMeasure =
VAR vMaxValue = MAX( myTable[Value] )
VAR vCategory =
SWITCH(
TRUE(),
vMaxValue < 10, "Low",
vMaxValue < 20, "Medium",
"High"
)
RETURN
LOOKUPVALUE(
myResultTable[ResultColumn],
myResultTable[SearchColumn], vCategory
)
Hi all,
thank you very much for your contributions.
I checked all of your proposals. All of them worked out fine so it is hard to decide "the one" accepted.
I favoured Selimovd's solution, because this one matches most my way of thinking.
The fun fact: I possibly made my issue not clear enough. I asked the follwing:
"I would like to use this value to check in a IF-THEN-ELSE-Kind of functionality to return a plain text like 'High', 'Medium', 'Low'."
What I meant was: "I would like to refer to this visual's value to check ..... ".
Reason why: I do VBA-Programming (MS-Access) and sometimes there is the need to refer to a value within a control. I thought there is a similar approach in PBI.
But nevertheless, all your proposals have made my day.
Thank you very much.
Thomas
Hey @thomasreick ,
sure, that's possible.
Try the following:
MyMeasure =
VAR vMaxValue = MAX( myTable[Value] )
VAR vCategory =
SWITCH(
TRUE(),
vMaxValue < 10, "Low",
vMaxValue < 20, "Medium",
"High"
)
RETURN
LOOKUPVALUE(
myResultTable[ResultColumn],
myResultTable[SearchColumn], vCategory
)
@thomasreick Well, you could write a DAX measure similar to:
Measure =
VAR __Max = MAX('Table'[Column]) //this would be filtered to whatever your card visual is
RETURN
SWITCH(
<condition 1>,"Result 1",
<condition 2>,"Result 2",
<condition 3>,"Result 3",
<default condition>
) //you can compare with the __Max variable in your conditions.
@thomasreick , I think you can do that.
Assume you have an independent bucket table with Min max and value
Example measure
maxx(filter('Bucket', Bucket[Min] <= [Measure] && Bucket[Max] >= [Measure]), 'Bucket'[Value]])
also refer
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k
@thomasreick
Yes, it's possible. you can create a measure to evaluate into text values and use it to look up on a table to fetch a matching record and the required value.
Please share sample data and the expected result.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
156 | |
121 | |
73 | |
73 | |
63 |