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 All,
i am trying to acheive the below logic in power bi can anyone help me
If my selected value date is greater than the bill date and paydate is greater than the selected value date then bill amt else 0. But,if i apply the below logic its not giving the exact result.
Logic being used currently:-
Screenshot of applied logic:
Hi, @Akhil_1411
Based on your description, I created data to reproduce your scenario.
Sheet1:
Date new(a calculated table):
Date new = CALENDARAUTO()
There is no relationship between two tables:
You may create a measure as below.
IsDisplay =
var _selecteddate = SELECTEDVALUE('Date new'[Date])
var _billdate = SELECTEDVALUE(Sheet1[bill date/Invoice date])
var _paymentdate = SELECTEDVALUE(Sheet1[payment_date])
return
IF(
_selecteddate>_billdate&&
_selecteddate<_paymentdate,
1,0
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-alq-msft ,
The above logic works perfectly, the only thing is total is not calculating . Can you tell me is there anything i am missing or any suggestions.
Hi, @Akhil_1411
If you want to display the right total, you may create a measure as follows.
Result =
var _selecteddate = SELECTEDVALUE('Date new'[Date])
var tab =
SUMMARIZE(
Sheet1,
Sheet1[bill date/Invoice date],
Sheet1[payment_date],
"flag",
var _billdate = Sheet1[bill date/Invoice date]
var _paymentdate = Sheet1[payment_date]
return
IF(
_selecteddate>_billdate&&
_selecteddate<_paymentdate,
1,0
)
)
return
SUMX(
tab,
[flag]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
104 | |
95 | |
80 | |
67 | |
62 |
User | Count |
---|---|
138 | |
107 | |
104 | |
82 | |
63 |