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.
Hi Community,
I have a challenge in calculating a difference between last 2 days in the below shown table ( 8/4/2021 and 8/5/2021) . Once the difference is calculated , I have to show either an Up arrow or Down arrow to represent Increase or decrease .
Output I want :
Thanks,
G venkatesh
Solved! Go to Solution.
Hi, @Anonymous ;
You could create a measure as follows:
Measure = var _max=MAX([Date])
var _last=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Jobname]),[Date]=_max))
var _pre=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Jobname]),[Date]=_max-1))
return IF(ISINSCOPE('Table'[Date]),SUM([Value]),_last-_pre)
Then add conditional formatting.
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yalanwu-msft , @selimovd and @amitchandak ,
Sorry for late in getting back to all of you,
I liked all of your solutions and everyone of your ideas is unique of itself. Thanks for helping me out .
@amitchandak Thanks for your detail explanation and for covering each aspect.
@selimovd 🙂 Thanks for your idea . Really liked the simple way of projecting it .
@v-yalanwu-msft Your idea of using Variables have made me think of learning more about variables a lot. I heard from Marco and Alberto explaining the significance of using variables . you have provided me a solution related to a different issue and that was solved using variables again . 🙂
Thanks,
G Venkatesh
Hi, @Anonymous ;
You could create a measure as follows:
Measure = var _max=MAX([Date])
var _last=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Jobname]),[Date]=_max))
var _pre=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Jobname]),[Date]=_max-1))
return IF(ISINSCOPE('Table'[Date]),SUM([Value]),_last-_pre)
Then add conditional formatting.
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @Anonymous ,
you can get the difference like this:
Difference to yesterday =
[myMeasure]
- CALCULATE(
[myMeasure],
DATEADD(
dateTable[date],
-1,
DAY
)
)
For the arrows you just have to compare if the value is bigger than 0 or smaller:
Conditional Formatting Using Icons In Power BI - Excelerator BI
@Anonymous , You have to create day on Day diff measure, for example using a date table
This Day = CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Date]=max("Date"[Date])))
Last Day = CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Date]=max("Date"[Date])-1))
Last Day = CALCULATE(sum("order"[Qty]), previousday("Date"[Date]))
diff =[This Day] - [Last Day]
One of the ways is to show diff in column total using isinscope and do icon conditional formatting only on total
if(isinscope(Date[Date]),[This Day], [diff])
refer if needed
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692
Or create a hybrid table
if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428
vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |