Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am having the below measure and now wanted to modify it to include the logic
if the date is less than or equal to 30 June 2022
Solved! Go to Solution.
@gauravnarchal , measure when
If gross is a column
Sumx(Table,Switch( True() ,
[Invoice date] <= date(2022,06,30),
Switch( True(),
[Gross Amount] < 7000,0,
[Gross Amount]>45000,5000,
[Gross Amount]*.03) ,
[Invoice date] >= date(2022,07,01),
Switch( True(),
[Gross Amount]>4500,[Gross Amount] * 0.03,
[Gross Amount]<=65000,[Gross Amount]*.04,
[Gross Amount]>65001,[Gross Amount]*.05)) )
if gross is a measure
Switch( True() ,
max([Invoice date]) <= date(2022,06,30),
Switch( True(),
[Gross Amount] < 7000,0,
[Gross Amount]>45000,5000,
[Gross Amount]*.03) ,
max([Invoice date]) >= date(2022,07,01),
Switch( True(),
[Gross Amount]>4500,[Gross Amount] * 0.03,
[Gross Amount]<=65000,[Gross Amount]*.04,
[Gross Amount]>65001,[Gross Amount]*.05))
yet to check the file
@gauravnarchal , try like
calculate(
Sumx(Values(Invoices[AgentNumber]),
CALCULATE(IF([Amount]<7000,0,
IF([Amount]>100001,5000,([Amount]*.05))))), filter(Table,Table[Date] <= date(2022,06,30)))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@amitchandak - i tried the logic that you have provided but it is not returning the desired result.
I have attach the PBIX file for your reference. Click Here
Thank you for your help.
Condition
First
Invoice date is less than equal to 30 June 2022
IF([Gross Amount]<7000,0,
IF([Gross Amount]>45000,5000,([Gross Amount]*.03
Second
Invoice date is greater than equal to 01 July 2022
IF([Gross Amount]<=4500,[Gross Amount] * 0.03,
IF([Gross Amount]<=65000,[Gross Amount]*.04,
IF([Gross Amount]>65001,[Gross Amount]*.05
@gauravnarchal , measure when
If gross is a column
Sumx(Table,Switch( True() ,
[Invoice date] <= date(2022,06,30),
Switch( True(),
[Gross Amount] < 7000,0,
[Gross Amount]>45000,5000,
[Gross Amount]*.03) ,
[Invoice date] >= date(2022,07,01),
Switch( True(),
[Gross Amount]>4500,[Gross Amount] * 0.03,
[Gross Amount]<=65000,[Gross Amount]*.04,
[Gross Amount]>65001,[Gross Amount]*.05)) )
if gross is a measure
Switch( True() ,
max([Invoice date]) <= date(2022,06,30),
Switch( True(),
[Gross Amount] < 7000,0,
[Gross Amount]>45000,5000,
[Gross Amount]*.03) ,
max([Invoice date]) >= date(2022,07,01),
Switch( True(),
[Gross Amount]>4500,[Gross Amount] * 0.03,
[Gross Amount]<=65000,[Gross Amount]*.04,
[Gross Amount]>65001,[Gross Amount]*.05))
yet to check the file
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
57 | |
36 | |
31 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |