Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi Praveen_k,
According to your description, you need to display the ID which have measure value >0, right?
If that is the case, you can create a calculated column to display if the current have measure value >0 or not. I have tested it on my local environment, here is the sample DAX expression below for you reference.
Check = IF(IFfunction[measure]<0,1,0)
Sciler = IF(CALCULATE(SUM(IFfunction[Check]),ALLEXCEPT(IFfunction,IFfunction[id]))>0,"<0",">0")
Regards,
Charlie Liao
@praveen_k I'm assuming you want to keep the measure column. And my other assumption is that you want to keep the measure if the value is greater than or equal to zero, and everything that is under should be the ID. Here is a calc column that will work for what you are asking. If this is not accurate, please clarify the discription.
Value = IF('table'[measure] >= 0, 'table'[measure], 'table'[id])
Hi @Seth_C_Bauer
Just a quick note on your formula regarding best practise
we should avoid putting the Table name next to the measure
ref: top 5 best practise tips
@praveen_kAs Eno suggested your calc column should work, but I'd suggest appending the result with something so that the reader knows that the value returned is either the Id or the result of a mesaure
@Neuro81 Thanks for pointing that out. I just used the quick defaults on this one, but I typically have been referencing my calculated columns the same as normal columns (with table name), and measures as the only outlier (no table name). Must have mis-read this in my reading.
@Seth_C_Bauer @Neuro81 Thanks for your inputs.
This is the actual measure calculation.
I tried using your expression and this is what I get -
On the reports, I would like to view the ID column when when measure2 > 0 and Null/Blank when measure2 < 0.
Hope this clarifies my original question.
Correction to the above reply -
On the reports, I would like to view the ID column when when measure1 > 0 and Null/Blank when measure1 < 0.
@praveen_k This initial code is for a Calculated Column.
This should work for a measure:
AsMeasure = IF([measure1] >= 0, VALUES('table'[id]), BLANK())
Error Message:
MdxScript(Model) (1, 51) Calculation error in measure 'Table'[Measure2]: A table of multiple values was supplied where a single value was expected.
I tried to choose table and card visualizations on the report to display measure2 value, and I see this error.
Am I doign somehing wrong ?
@praveen_k If you are going to filter it down to see the individual rows, you can use the original calculation as a calculated column. The slicer works with that.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
113 | |
105 | |
95 | |
58 |
User | Count |
---|---|
175 | |
147 | |
134 | |
105 | |
82 |