Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi there,
Please I need some urgent help. I am trying to calculate my quantity values where I duplicate a value for friday to reflect on saturday as well. Here is a sample data
Data:
| Date | Category | qty |
| 3/27/2022 | a | 2,000 |
| 3/27/2022 | b | 2,050 |
| 3/27/2022 | c | 3,100 |
| 3/26/2022 | b | 2,600 |
| 3/26/2022 | c | 3,000 |
| 3/25/2022 | a | 1,000 |
| 3/25/2022 | b | 1,500 |
| 3/25/2022 | c | 2,300 |
Current results without the category column:
| Date | qty |
| 3/27/2022 | 7,150 |
| 3/26/2022 | 5,600 |
| 3/25/2022 | 4,800 |
Expected results if we duplicate every Friday value for category a only to add on Saturdays as well:
| Date | qty | Comments |
| 3/27/2022 | 7,150 | |
| 3/26/2022 | 6,600 | 5,600 +1,000 from 3/25 which is a friday |
| 3/25/2022 | 4,800 |
Please thank you very much.
Solved! Go to Solution.
Hi @yve214
not sure if I fully understand the requirement. However, please try
Total Qty =
VAR CurrentValue =
SUM ( TableName[qty] )
VAR PreviousValue =
CALCULATE (
SUM ( TableName[qty] ),
'Date'[Date]
= MAX ( 'Date'[Date] ) - 1,
TableName[Category] = "a"
)
RETURN
IF (
MAX ( 'Date'[Week Day Name] ) = "Saturday",
CurrentValue + PreviousValue,
CurrentValue
)
Hi @yve214
not sure if I fully understand the requirement. However, please try
Total Qty =
VAR CurrentValue =
SUM ( TableName[qty] )
VAR PreviousValue =
CALCULATE (
SUM ( TableName[qty] ),
'Date'[Date]
= MAX ( 'Date'[Date] ) - 1,
TableName[Category] = "a"
)
RETURN
IF (
MAX ( 'Date'[Week Day Name] ) = "Saturday",
CurrentValue + PreviousValue,
CurrentValue
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |