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
I have the following calculations:
Solved! Go to Solution.
Hi @NadiaLR1234 ,
I create a sample table:
You can try this method:
New a measure:
AvgRental =
VAR _avg =
CALCULATE (
DIVIDE ( SUM ( vw_REN_PBI[TotalSales] ), SUM ( vw_REN_PBI[Trns] ) ),
ALL ( vw_REN_PBI )
)
VAR _AvgC =
CALCULATE (
DIVIDE ( SUM ( vw_REN_PBI[TotalSales] ), SUM ( vw_REN_PBI[ProdNoDays2] ) ),
ALL ( vw_REN_PBI )
)
RETURN
IF (
MAX ( 'vw_REN_PBI'[ProdTypeDesc] ) = "car",
_AvgC,
IF ( MAX ( 'vw_REN_PBI'[ProdTypeDesc] ) = "Transfer", _avg )
)
The result is:
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NadiaLR1234 ,
I create a sample table:
You can try this method:
New a measure:
AvgRental =
VAR _avg =
CALCULATE (
DIVIDE ( SUM ( vw_REN_PBI[TotalSales] ), SUM ( vw_REN_PBI[Trns] ) ),
ALL ( vw_REN_PBI )
)
VAR _AvgC =
CALCULATE (
DIVIDE ( SUM ( vw_REN_PBI[TotalSales] ), SUM ( vw_REN_PBI[ProdNoDays2] ) ),
ALL ( vw_REN_PBI )
)
RETURN
IF (
MAX ( 'vw_REN_PBI'[ProdTypeDesc] ) = "car",
_AvgC,
IF ( MAX ( 'vw_REN_PBI'[ProdTypeDesc] ) = "Transfer", _avg )
)
The result is:
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I meant AvgRental = IF(ProdTypeDesc = "Car", AvgC, IF(ProdTypeDesc = "Transfer", Avg)
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 |
---|---|
113 | |
97 | |
79 | |
73 | |
56 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |